AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
|
#include "buffer_sizes.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdint.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/select.h>
#include <sys/errno.h>
#include <arpa/inet.h>
Go to the source code of this file.
Data Structures | |
struct | BT_HDR |
Macros | |
#define | BOOLEAN int |
#define | TRUE 1 |
#define | FALSE 0 |
#define | NCI_BRCM_CO_ID 0x2E |
#define | NCI_MSG_HDR_SIZE 3 /* per NCI spec */ |
#define | NCI_DATA_HDR_SIZE 3 /* per NCI spec */ |
#define | NCI_MAX_PAYLOAD_SIZE 0xFE |
#define | NCI_MAX_CTRL_SIZE 0xFF /* max control message size */ |
#define | NCI_CTRL_INIT_SIZE 32 /* initial NFCC control payload size */ |
#define | NCI_MAX_VSC_SIZE 0xFF |
#define | NCI_VSC_MSG_HDR_SIZE 12 /* NCI header (3) + callback function pointer(8; use 8 to be safe) + HCIT (1 byte) */ |
#define | NCI_TL_SIZE 2 |
#define | NCI_ISO_DEP_MAX_INFO |
#define | NCI_NFC_DEP_MAX_DATA 251 /* Max payload (254) - Protocol Header (3) in NFC-DEP, DID and NAD are not used */ |
#define | NCI_MT_MASK 0xE0 |
#define | NCI_MT_SHIFT 5 |
#define | NCI_MT_DATA 0x00 |
#define | NCI_MT_CMD 1 /* (NCI_MT_CMD << NCI_MT_SHIFT) = 0x20 */ |
#define | NCI_MT_RSP 2 /* (NCI_MT_RSP << NCI_MT_SHIFT) = 0x40 */ |
#define | NCI_MT_NTF 3 /* (NCI_MT_NTF << NCI_MT_SHIFT) = 0x60 */ |
#define | NCI_MT_CFG 4 /* (NCI_MT_CFG << NCI_MT_SHIFT) = 0x80 */ |
#define | NCI_MTS_CMD 0x20 |
#define | NCI_MTS_RSP 0x40 |
#define | NCI_MTS_NTF 0x60 |
#define | NCI_MTS_CFG 0x80 |
#define | NCI_NTF_BIT 0x80 /* the tNFC_VS_EVT is a notification */ |
#define | NCI_RSP_BIT 0x40 /* the tNFC_VS_EVT is a response */ |
#define | NCI_LS_DATA 0x00 |
#define | NCI_LS_DATA_PBF 0x01 |
#define | NCI_PBF_MASK 0x10 |
#define | NCI_PBF_SHIFT 4 |
#define | NCI_PBF_NO_OR_LAST 0x00 /* not fragmented or last fragment */ |
#define | NCI_PBF_ST_CONT 0x10 /* start or continuing fragment */ |
#define | NCI_GID_MASK 0x0F |
#define | NCI_GID_SHIFT 0 |
#define | NCI_GID_CORE 0x00 /* 0000b NCI Core group */ |
#define | NCI_GID_RF_MANAGE 0x01 /* 0001b RF Management group */ |
#define | NCI_GID_EE_MANAGE 0x02 /* 0010b NFCEE Management group */ |
#define | NCI_GID_PROP 0x0F /* 1111b Proprietary */ |
#define | NCI_OID_MASK 0x3F |
#define | NCI_OID_SHIFT 0 |
#define | NCI_DH_ID 0 /* for DH */ |
#define | NCI_TEST_ID 0xFE /* for loopback test */ |
#define | NCI_DEST_TYPE_NFCC 1 /* NFCC - loopback */ |
#define | NCI_DEST_TYPE_REMOTE 2 /* Remote NFC Endpoint */ |
#define | NCI_DEST_TYPE_NFCEE 3 /* NFCEE */ |
#define | NCI_MSG_BLD_HDR0(p, mt, gid) *(p)++ = (uint8_t)(((mt) << NCI_MT_SHIFT) | (gid)); |
#define | NCI_MSG_PBLD_HDR0(p, mt, pbf, gid) *(p)++ = (uint8_t)(((mt) << NCI_MT_SHIFT) | ((pbf) << NCI_PBF_SHIFT) | (gid)); |
#define | NCI_MSG_BLD_HDR1(p, oid) *(p)++ = (uint8_t)(((oid) << NCI_OID_SHIFT)); |
#define | NCI_MSG_PRS_HDR0(p, mt, pbf, gid) |
#define | NCI_MSG_PRS_MT_PBF(p, mt, pbf) |
#define | NCI_MSG_PRS_HDR1(p, oid) |
#define | NCI_CID_MASK 0x0F |
#define | NCI_DATA_BLD_HDR(p, cid, len) |
#define | NCI_DATA_PBLD_HDR(p, pbf, cid, len) |
#define | NCI_DATA_PRS_HDR(p, pbf, cid, len) |
#define | BE_STREAM_TO_uint32_t(u32, p) |
#define | NFA_TNF_EMPTY NDEF_TNF_EMPTY /* Empty or no type specified */ |
#define | NFA_TNF_WKT NDEF_TNF_WKT /* NFC Forum well-known type [NFC RTD] */ |
#define | NFA_TNF_RFC2046_MEDIA NDEF_TNF_MEDIA /* Media-type as defined in RFC 2046 [RFC 2046] */ |
#define | NFA_TNF_RFC3986_URI NDEF_TNF_URI /* Absolute URI as defined in RFC 3986 [RFC 3986] */ |
#define | NFA_TNF_EXTERNAL NDEF_TNF_EXT /* NFC Forum external type [NFC RTD] */ |
#define | NFA_TNF_UNKNOWN case NDEF_TNF_UNKNOWN /* Unknown */ |
#define | NFA_TNF_UNCHANGED NDEF_TNF_UNCHANGED /* Unchanged */ |
#define | NFA_TNF_RESERVED NDEF_TNF_RESERVED /* Reserved */ |
#define | NFA_TNF_DEFAULT case 0xFF /* Used to register default NDEF type handler */ |
#define | NDEF_MB_MASK 0x80 /* Message Begin */ |
#define | NDEF_ME_MASK 0x40 /* Message End */ |
#define | NDEF_CF_MASK 0x20 /* Chunk Flag */ |
#define | NDEF_SR_MASK 0x10 /* Short Record */ |
#define | NDEF_IL_MASK 0x08 /* ID Length */ |
#define | NDEF_TNF_MASK 0x07 /* Type Name Format */ |
#define | NDEF_TNF_EMPTY 0 /* Empty (type/id/payload len =0) */ |
#define | NDEF_TNF_WKT 1 /* NFC Forum well-known type/RTD */ |
#define | NDEF_TNF_MEDIA 2 /* Media-type as defined in RFC 2046 */ |
#define | NDEF_TNF_URI 3 /* Absolute URI as defined in RFC 3986 */ |
#define | NDEF_TNF_EXT 4 /* NFC Forum external type/RTD */ |
#define | NDEF_TNF_UNKNOWN 5 /* Unknown (type len =0) */ |
#define | NDEF_TNF_UNCHANGED 6 /* Unchanged (type len =0) */ |
#define | NDEF_TNF_RESERVED 7 /* Reserved */ |
#define | INVALID_SOCKET -1 |
#define | NCI_MSG_RF_INTF_ACTIVATED 5 |
Typedefs | |
typedef uint8_t | tNDEF_STATUS |
typedef uint8_t | tNFA_TNF |
typedef int | SOCKET |
typedef struct sockaddr_in | SOCKADDR_IN |
typedef struct sockaddr | SOCKADDR |
typedef struct in_addr | IN_ADDR |
Functions | |
void | printError (tNDEF_STATUS status) |
tNDEF_STATUS | NDEF_MsgValidate (uint8_t *p_msg, uint32_t msg_len, BOOLEAN b_allow_chunks) |
void | printbuff0 (uint8_t *p_rec, uint8_t *repere) |
void | printbuff (uint8_t *p_rec, int len) |
uint8_t * | NDEF_RecGetType (uint8_t *p_rec, uint8_t *p_tnf, uint8_t *p_type_len) |
uint8_t * | NDEF_RecGetId (uint8_t *p_rec, uint8_t *p_id_len) |
uint8_t * | NDEF_RecGetPayload (uint8_t *p_rec, uint32_t *p_payload_len) |
void | createBufNdef_TypeURI (uint8_t *strIN, int sizLen, uint8_t *strOUT) |
void | createBufNdef_TypeText (uint8_t *strIN, int sizLen, uint8_t *strOUT) |
void | createBufNdef_TypeSmartPoster (uint8_t *strIN, int sizLen, uint8_t *strOUT) |
SOCKET | open_socket (char *ip, short port) |
int | tcp_write_buff (int sock, unsigned char *data, int len) |
SOCKET | getconnect () |
void | vshort_actidata (uint8_t *strIN, int sizLen, uint8_t *strOUT) |
void | vshort_sendata (uint8_t *strIN, int sizLen, uint8_t *strOUT) |
int | main (int argc, char *argv[]) |
#define BE_STREAM_TO_uint32_t | ( | u32, | |
p | |||
) |
Definition at line 140 of file testValidateNFC.c.
#define BOOLEAN int |
Definition at line 8 of file testValidateNFC.c.
#define FALSE 0 |
Definition at line 10 of file testValidateNFC.c.
#define INVALID_SOCKET -1 |
Definition at line 692 of file testValidateNFC.c.
#define NCI_BRCM_CO_ID 0x2E |
Definition at line 12 of file testValidateNFC.c.
#define NCI_CID_MASK 0x0F |
Definition at line 118 of file testValidateNFC.c.
#define NCI_CTRL_INIT_SIZE 32 /* initial NFCC control payload size */ |
Definition at line 20 of file testValidateNFC.c.
#define NCI_DATA_BLD_HDR | ( | p, | |
cid, | |||
len | |||
) |
Definition at line 121 of file testValidateNFC.c.
#define NCI_DATA_HDR_SIZE 3 /* per NCI spec */ |
Definition at line 17 of file testValidateNFC.c.
#define NCI_DATA_PBLD_HDR | ( | p, | |
pbf, | |||
cid, | |||
len | |||
) |
Definition at line 126 of file testValidateNFC.c.
#define NCI_DATA_PRS_HDR | ( | p, | |
pbf, | |||
cid, | |||
len | |||
) |
Definition at line 131 of file testValidateNFC.c.
#define NCI_DEST_TYPE_NFCC 1 /* NFCC - loopback */ |
Definition at line 84 of file testValidateNFC.c.
#define NCI_DEST_TYPE_NFCEE 3 /* NFCEE */ |
Definition at line 86 of file testValidateNFC.c.
#define NCI_DEST_TYPE_REMOTE 2 /* Remote NFC Endpoint */ |
Definition at line 85 of file testValidateNFC.c.
#define NCI_DH_ID 0 /* for DH */ |
Definition at line 79 of file testValidateNFC.c.
#define NCI_GID_CORE 0x00 /* 0000b NCI Core group */ |
Definition at line 68 of file testValidateNFC.c.
#define NCI_GID_EE_MANAGE 0x02 /* 0010b NFCEE Management group */ |
Definition at line 70 of file testValidateNFC.c.
#define NCI_GID_MASK 0x0F |
Definition at line 66 of file testValidateNFC.c.
#define NCI_GID_PROP 0x0F /* 1111b Proprietary */ |
Definition at line 71 of file testValidateNFC.c.
#define NCI_GID_RF_MANAGE 0x01 /* 0001b RF Management group */ |
Definition at line 69 of file testValidateNFC.c.
#define NCI_GID_SHIFT 0 |
Definition at line 67 of file testValidateNFC.c.
#define NCI_ISO_DEP_MAX_INFO |
Definition at line 26 of file testValidateNFC.c.
#define NCI_LS_DATA 0x00 |
Definition at line 56 of file testValidateNFC.c.
#define NCI_LS_DATA_PBF 0x01 |
Definition at line 57 of file testValidateNFC.c.
#define NCI_MAX_CTRL_SIZE 0xFF /* max control message size */ |
Definition at line 19 of file testValidateNFC.c.
#define NCI_MAX_PAYLOAD_SIZE 0xFE |
Definition at line 18 of file testValidateNFC.c.
#define NCI_MAX_VSC_SIZE 0xFF |
Definition at line 21 of file testValidateNFC.c.
#define NCI_MSG_BLD_HDR0 | ( | p, | |
mt, | |||
gid | |||
) | *(p)++ = (uint8_t)(((mt) << NCI_MT_SHIFT) | (gid)); |
Definition at line 89 of file testValidateNFC.c.
#define NCI_MSG_BLD_HDR1 | ( | p, | |
oid | |||
) | *(p)++ = (uint8_t)(((oid) << NCI_OID_SHIFT)); |
Definition at line 95 of file testValidateNFC.c.
#define NCI_MSG_HDR_SIZE 3 /* per NCI spec */ |
Definition at line 16 of file testValidateNFC.c.
#define NCI_MSG_PBLD_HDR0 | ( | p, | |
mt, | |||
pbf, | |||
gid | |||
) | *(p)++ = (uint8_t)(((mt) << NCI_MT_SHIFT) | ((pbf) << NCI_PBF_SHIFT) | (gid)); |
Definition at line 91 of file testValidateNFC.c.
#define NCI_MSG_PRS_HDR0 | ( | p, | |
mt, | |||
pbf, | |||
gid | |||
) |
Definition at line 98 of file testValidateNFC.c.
#define NCI_MSG_PRS_HDR1 | ( | p, | |
oid | |||
) |
Definition at line 109 of file testValidateNFC.c.
#define NCI_MSG_PRS_MT_PBF | ( | p, | |
mt, | |||
pbf | |||
) |
Definition at line 104 of file testValidateNFC.c.
#define NCI_MSG_RF_INTF_ACTIVATED 5 |
#define NCI_MT_CFG 4 /* (NCI_MT_CFG << NCI_MT_SHIFT) = 0x80 */ |
Definition at line 44 of file testValidateNFC.c.
#define NCI_MT_CMD 1 /* (NCI_MT_CMD << NCI_MT_SHIFT) = 0x20 */ |
Definition at line 41 of file testValidateNFC.c.
#define NCI_MT_DATA 0x00 |
Definition at line 40 of file testValidateNFC.c.
#define NCI_MT_MASK 0xE0 |
Definition at line 38 of file testValidateNFC.c.
#define NCI_MT_NTF 3 /* (NCI_MT_NTF << NCI_MT_SHIFT) = 0x60 */ |
Definition at line 43 of file testValidateNFC.c.
#define NCI_MT_RSP 2 /* (NCI_MT_RSP << NCI_MT_SHIFT) = 0x40 */ |
Definition at line 42 of file testValidateNFC.c.
#define NCI_MT_SHIFT 5 |
Definition at line 39 of file testValidateNFC.c.
#define NCI_MTS_CFG 0x80 |
Definition at line 49 of file testValidateNFC.c.
#define NCI_MTS_CMD 0x20 |
Definition at line 46 of file testValidateNFC.c.
#define NCI_MTS_NTF 0x60 |
Definition at line 48 of file testValidateNFC.c.
#define NCI_MTS_RSP 0x40 |
Definition at line 47 of file testValidateNFC.c.
#define NCI_NFC_DEP_MAX_DATA 251 /* Max payload (254) - Protocol Header (3) in NFC-DEP, DID and NAD are not used */ |
Definition at line 29 of file testValidateNFC.c.
#define NCI_NTF_BIT 0x80 /* the tNFC_VS_EVT is a notification */ |
Definition at line 51 of file testValidateNFC.c.
#define NCI_OID_MASK 0x3F |
Definition at line 75 of file testValidateNFC.c.
#define NCI_OID_SHIFT 0 |
Definition at line 76 of file testValidateNFC.c.
#define NCI_PBF_MASK 0x10 |
Definition at line 60 of file testValidateNFC.c.
#define NCI_PBF_NO_OR_LAST 0x00 /* not fragmented or last fragment */ |
Definition at line 62 of file testValidateNFC.c.
#define NCI_PBF_SHIFT 4 |
Definition at line 61 of file testValidateNFC.c.
#define NCI_PBF_ST_CONT 0x10 /* start or continuing fragment */ |
Definition at line 63 of file testValidateNFC.c.
#define NCI_RSP_BIT 0x40 /* the tNFC_VS_EVT is a response */ |
Definition at line 52 of file testValidateNFC.c.
#define NCI_TEST_ID 0xFE /* for loopback test */ |
Definition at line 81 of file testValidateNFC.c.
#define NCI_TL_SIZE 2 |
Definition at line 24 of file testValidateNFC.c.
#define NCI_VSC_MSG_HDR_SIZE 12 /* NCI header (3) + callback function pointer(8; use 8 to be safe) + HCIT (1 byte) */ |
Definition at line 22 of file testValidateNFC.c.
#define NDEF_CF_MASK 0x20 /* Chunk Flag */ |
Definition at line 196 of file testValidateNFC.c.
#define NDEF_IL_MASK 0x08 /* ID Length */ |
Definition at line 198 of file testValidateNFC.c.
#define NDEF_MB_MASK 0x80 /* Message Begin */ |
Definition at line 194 of file testValidateNFC.c.
#define NDEF_ME_MASK 0x40 /* Message End */ |
Definition at line 195 of file testValidateNFC.c.
#define NDEF_SR_MASK 0x10 /* Short Record */ |
Definition at line 197 of file testValidateNFC.c.
#define NDEF_TNF_EMPTY 0 /* Empty (type/id/payload len =0) */ |
Definition at line 202 of file testValidateNFC.c.
#define NDEF_TNF_EXT 4 /* NFC Forum external type/RTD */ |
Definition at line 206 of file testValidateNFC.c.
#define NDEF_TNF_MASK 0x07 /* Type Name Format */ |
Definition at line 199 of file testValidateNFC.c.
#define NDEF_TNF_MEDIA 2 /* Media-type as defined in RFC 2046 */ |
Definition at line 204 of file testValidateNFC.c.
#define NDEF_TNF_RESERVED 7 /* Reserved */ |
Definition at line 209 of file testValidateNFC.c.
#define NDEF_TNF_UNCHANGED 6 /* Unchanged (type len =0) */ |
Definition at line 208 of file testValidateNFC.c.
#define NDEF_TNF_UNKNOWN 5 /* Unknown (type len =0) */ |
Definition at line 207 of file testValidateNFC.c.
#define NDEF_TNF_URI 3 /* Absolute URI as defined in RFC 3986 */ |
Definition at line 205 of file testValidateNFC.c.
#define NDEF_TNF_WKT 1 /* NFC Forum well-known type/RTD */ |
Definition at line 203 of file testValidateNFC.c.
#define NFA_TNF_DEFAULT case 0xFF /* Used to register default NDEF type handler */ |
Definition at line 191 of file testValidateNFC.c.
#define NFA_TNF_EMPTY NDEF_TNF_EMPTY /* Empty or no type specified */ |
Definition at line 183 of file testValidateNFC.c.
#define NFA_TNF_EXTERNAL NDEF_TNF_EXT /* NFC Forum external type [NFC RTD] */ |
Definition at line 187 of file testValidateNFC.c.
#define NFA_TNF_RESERVED NDEF_TNF_RESERVED /* Reserved */ |
Definition at line 190 of file testValidateNFC.c.
#define NFA_TNF_RFC2046_MEDIA NDEF_TNF_MEDIA /* Media-type as defined in RFC 2046 [RFC 2046] */ |
Definition at line 185 of file testValidateNFC.c.
#define NFA_TNF_RFC3986_URI NDEF_TNF_URI /* Absolute URI as defined in RFC 3986 [RFC 3986] */ |
Definition at line 186 of file testValidateNFC.c.
#define NFA_TNF_UNCHANGED NDEF_TNF_UNCHANGED /* Unchanged */ |
Definition at line 189 of file testValidateNFC.c.
#define NFA_TNF_UNKNOWN case NDEF_TNF_UNKNOWN /* Unknown */ |
Definition at line 188 of file testValidateNFC.c.
#define NFA_TNF_WKT NDEF_TNF_WKT /* NFC Forum well-known type [NFC RTD] */ |
Definition at line 184 of file testValidateNFC.c.
#define TRUE 1 |
Definition at line 9 of file testValidateNFC.c.
typedef struct in_addr IN_ADDR |
Definition at line 691 of file testValidateNFC.c.
typedef struct sockaddr SOCKADDR |
Definition at line 690 of file testValidateNFC.c.
typedef struct sockaddr_in SOCKADDR_IN |
Definition at line 689 of file testValidateNFC.c.
typedef int SOCKET |
Definition at line 688 of file testValidateNFC.c.
typedef uint8_t tNDEF_STATUS |
Definition at line 180 of file testValidateNFC.c.
typedef uint8_t tNFA_TNF |
Definition at line 192 of file testValidateNFC.c.
anonymous enum |
Definition at line 165 of file testValidateNFC.c.
void createBufNdef_TypeSmartPoster | ( | uint8_t * | strIN, |
int | sizLen, | ||
uint8_t * | strOUT | ||
) |
void createBufNdef_TypeText | ( | uint8_t * | strIN, |
int | sizLen, | ||
uint8_t * | strOUT | ||
) |
void createBufNdef_TypeURI | ( | uint8_t * | strIN, |
int | sizLen, | ||
uint8_t * | strOUT | ||
) |
SOCKET getconnect | ( | ) |
Definition at line 731 of file testValidateNFC.c.
int main | ( | int | argc, |
char * | argv[] | ||
) |
tNDEF_STATUS NDEF_MsgValidate | ( | uint8_t * | p_msg, |
uint32_t | msg_len, | ||
BOOLEAN | b_allow_chunks | ||
) |
uint8_t* NDEF_RecGetId | ( | uint8_t * | p_rec, |
uint8_t * | p_id_len | ||
) |
uint8_t* NDEF_RecGetPayload | ( | uint8_t * | p_rec, |
uint32_t * | p_payload_len | ||
) |
uint8_t* NDEF_RecGetType | ( | uint8_t * | p_rec, |
uint8_t * | p_tnf, | ||
uint8_t * | p_type_len | ||
) |
SOCKET open_socket | ( | char * | ip, |
short | port | ||
) |
void printbuff | ( | uint8_t * | p_rec, |
int | len | ||
) |
void printbuff0 | ( | uint8_t * | p_rec, |
uint8_t * | repere | ||
) |
Definition at line 407 of file testValidateNFC.c.
void printError | ( | tNDEF_STATUS | status | ) |
int tcp_write_buff | ( | int | sock, |
unsigned char * | data, | ||
int | len | ||
) |
void vshort_actidata | ( | uint8_t * | strIN, |
int | sizLen, | ||
uint8_t * | strOUT | ||
) |
void vshort_sendata | ( | uint8_t * | strIN, |
int | sizLen, | ||
uint8_t * | strOUT | ||
) |