• 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 
16 #ifndef RTDTEXT_H_
17 #define RTDTEXT_H_
18 
19 #include "NT3H.h"
20 
21 #define BIT_STATUS (1<<7)
22 #define BIT_RFU    (1<<6)
23 
24 #define MASK_STATUS 0x80
25 #define MASK_RFU    0x40
26 #define MASK_IANA   0b00111111
27 
28 typedef struct {
29     char *body;
30     uint8_t bodyLength;
31 } RtdTextUserPayload;
32 
33 typedef struct {
34     uint8_t     status;
35     uint8_t     language[2];
36     RtdTextUserPayload rtdPayload;
37 } RtdTextTypeStr;
38 
39 uint8_t addRtdText(RtdTextTypeStr *typeStr);
40 void prepareText(NDEFDataStr *data, RecordPosEnu position, uint8_t *text);
41 
42 #endif /* NDEFTEXT_H_ */
43