![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The host_interface_service.h file describes the structures and definitions for the host. More...
Go to the source code of this file.
Data Structures | |
struct | _host_interface_handle_ |
struct | _host_interface_config_ |
Macros | |
#define | HOST_INTERFACE_OK 0 |
#define | HOST_INTERFACE_VERSION ((1 << 4) | (0 & 0xF)) |
#define | HOST_INTERFACE_EVENT_SEND_COMPLETE (1UL << 0) |
Send completed. Completed the data transfer. Useful for Asynchronous, non blocking calls. More... | |
#define | HOST_INTERFACE_EVENT_RECEIVE_COMPLETE (1UL << 1) |
Receive completed, Receved specifed bytes of data. Useful for Asynchronous, non blocking calls. More... | |
Typedefs | |
typedef void(* | Host_Event_t) (uint32_t event) |
typedef struct _host_interface_handle_ | host_interface_handle_t |
typedef struct _host_interface_config_ | host_interface_config_t |
typedef void(* | BlockRead_t) (host_interface_handle_t *pHandle, void *pData) |
Functions | |
int32_t | HOST_Initialize (host_interface_handle_t *pHandle, comm_type_t type, void *pCommInstance, comm_instance_type_t inType, Host_Event_t event, void *pInData) |
The function to Initialize the Host. More... | |
int32_t | HOST_Configure (host_interface_handle_t *pHandle, void *pConfigData) |
The function to Configure the Host. More... | |
int32_t | HOST_Send (host_interface_handle_t *pHandle, uint8_t *pData, uint32_t size) |
The function to Send the data to the host. More... | |
int32_t | HOST_Receive (host_interface_handle_t *pHandle, uint8_t *pData, uint32_t *pRecvSize, uint32_t size, BlockRead_t process) |
The function to receive data from the host. More... | |
The host_interface_service.h file describes the structures and definitions for the host.
Definition in file host_interface_service.h.
#define HOST_INTERFACE_EVENT_RECEIVE_COMPLETE (1UL << 1) |
Receive completed, Receved specifed bytes of data. Useful for Asynchronous, non blocking calls.
Definition at line 79 of file host_interface_service.h.
#define HOST_INTERFACE_EVENT_SEND_COMPLETE (1UL << 0) |
Send completed. Completed the data transfer. Useful for Asynchronous, non blocking calls.
Definition at line 77 of file host_interface_service.h.
#define HOST_INTERFACE_OK 0 |
Definition at line 46 of file host_interface_service.h.
Referenced by HOST_Receive().
#define HOST_INTERFACE_VERSION ((1 << 4) | (0 & 0xF)) |
Definition at line 47 of file host_interface_service.h.
Referenced by Host_IO_Receive().
typedef void(* BlockRead_t) (host_interface_handle_t *pHandle, void *pData) |
Definition at line 82 of file host_interface_service.h.
typedef void(* Host_Event_t) (uint32_t event) |
Definition at line 53 of file host_interface_service.h.
typedef struct _host_interface_config_ host_interface_config_t |
typedef struct _host_interface_handle_ host_interface_handle_t |
int32_t HOST_Configure | ( | host_interface_handle_t * | pHandle, |
void * | pConfigData | ||
) |
The function to Configure the Host.
TBD
[in] | pHandle | - pointer to the interface handle |
[in] | pConfigData | - Host configuration information |
Definition at line 75 of file host_interface_service.c.
References _host_interface_handle_::commHandle, _comm_interface_::Configure, int32_t(), _host_interface_handle_::pCommInterface, and status.
Referenced by Host_IO_Receive().
int32_t HOST_Initialize | ( | host_interface_handle_t * | pHandle, |
comm_type_t | type, | ||
void * | pCommInstance, | ||
comm_instance_type_t | inType, | ||
Host_Event_t | event, | ||
void * | pInData | ||
) |
The function to Initialize the Host.
It initialize the host for the specified communucation channel and data format service.
[in] | pHandle | - pointer to the interface handle |
[in] | type- | host communication type |
[in] | pCommInstance | - pointer to a communication object. |
[in] | inType | - instanceType. |
[in] | event | - event handler callback |
[in] | pInData | - input data to underlying layers |
Definition at line 52 of file host_interface_service.c.
References COMM_UART, _host_interface_handle_::commHandle, commUART, _host_interface_handle_::event, _comm_interface_::Init, _host_interface_handle_::instanceType, int32_t(), _host_interface_handle_::pCommInterface, _host_interface_handle_::pInData, and status.
Referenced by Host_IO_Init().
int32_t HOST_Receive | ( | host_interface_handle_t * | pHandle, |
uint8_t * | pData, | ||
uint32_t * | pRecvSize, | ||
uint32_t | size, | ||
BlockRead_t | process | ||
) |
The function to receive data from the host.
BlockRead callback function will be called only if Host is initialized with Blocking Call communication instance, refer comm_instance_type_t inType HOST_Initialize() function. If the host is initialized with blocking communication instance, This call will be blocked until BlockRead_t process returns provided BlockRead_t process is not NULL else it will be blocked until specified number of requested bytes are received. User can implement own logic to separate packet start and end de-limiter in BlockRead_t process to determine a stream or use provided Block Read function in the each Data Format. If the host is intialized with NonBlocking Communication instance. This call will be immediately returns and Users Needs to Syschronous data based on Host event HOST_INTERFACE_EVENT_RECEIVE_COMPLETE.
[in] | pHandle | - pointer to the interface handle. |
[out] | pData | - pointer to data to be received. |
[out] | pRecvSize | - number of byte received. This field is for the future use. |
[in] | size | - Nnumber of byte intend to receive, if user know. This argument has no impact if "BlockRead_t process" is not NULL and communication instance is Blocking |
[in] | process | - process function for the block data read. NOTE: This parameter is not valid, if communication Read function is Nonblocking. The logic in the callback can start and end packet data detection to get the unknown receive length stream data from the host. |
Definition at line 93 of file host_interface_service.c.
References COMM_BLOCKING, _host_interface_handle_::commHandle, HOST_INTERFACE_OK, _host_interface_handle_::instanceType, int32_t(), _host_interface_handle_::pCommInterface, _comm_interface_::Receive, and status.
Referenced by Host_IO_Init(), and Host_IO_Receive().
int32_t HOST_Send | ( | host_interface_handle_t * | pHandle, |
uint8_t * | pData, | ||
uint32_t | size | ||
) |
The function to Send the data to the host.
TBD
[in] | pHandle | - pointer to the interface handle |
[in] | pData | - pointer to a data to send |
[in] | size | - number of byte to send |
Definition at line 84 of file host_interface_service.c.
References _host_interface_handle_::commHandle, int32_t(), _host_interface_handle_::pCommInterface, _comm_interface_::Send, and status.
Referenced by Host_IO_Send().