• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 FuZhou Lockzhiner Electronic Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef RTDURI_H_
16 #define RTDURI_H_
17 
18 #include "NT3H.h"
19 
20 typedef enum {
21     freeForm,       // 0x00     No prepending is done ... the entire URI is contained in the URI Field
22     httpWWW,        // 0x01     http://www.
23     httpsWWW,       // 0x02     https://www.
24     http,           // 0x03     http://
25     https,          // 0x04     https://
26     tel,            // 0x05     tel:
27     mailto,         // 0x06     mailto:
28     ftpAnonymous,   // 0x07     ftp://anonymous:anonymous@
29     ftpFtp,         // 0x08     ftp://ftp.
30     ftps,           // 0x09     ftps://
31     sftp,           // 0x0A     sftp://
32     smb,            // 0x0B     smb://
33     nfs,            // 0x0C     nfs://
34     ftp,            // 0x0D     ftp://
35     dav,            // 0x0E     dav://
36     news,           // 0x0F     news:
37     telnet,         // 0x10     telnet://
38     imap,           // 0x11     imap:
39     rtps,           // 0x12     rtsp://
40     urn,            // 0x13     urn:
41     /*
42         0x14     pop:
43         0x15     sip:
44         0x16     sips:
45         0x17     tftp:
46         0x18     btspp:     //
47         0x19     btl2cap:   //
48         0x1A     btgoep:    //
49         0x1B     tcpobex:   //
50         0x1C     irdaobex:  //
51         0x1D     file:      //
52         0x1E     urn:epc:id:
53         0x1F     urn:epc:tag:
54         0x20     urn:epc:pat:
55         0x21     urn:epc:raw:
56         0x22     urn:epc:
57         0x23     urn:nfc:
58      */
59 } UriTypeE;
60 
61 typedef struct {
62     char     *body;
63     uint8_t  bodyLength;
64     void     *extraData; // herre should be stored specific URI msgs
65 } RtdUriUserPayload;
66 
67 typedef struct {
68     UriTypeE            type;
69     RtdUriUserPayload   userPayload; // here should be stored specific URI msgs
70 } RTDUriTypeStr;
71 
72 uint8_t addRtdUriRecord(const NDEFDataStr *ndef, RTDUriTypeStr *uriType);
73 
74 void prepareUrihttp(NDEFDataStr *data, RecordPosEnu position, uint8_t *text);
75 
76 #endif /* RTDURI_H_ */
77