![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The dhost_interface_servicec file implements host interface functions. More...
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "host_interface_service.h"
Go to the source code of this file.
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... | |
Variables | |
comm_interface_t | commUART |
The dhost_interface_servicec file implements host interface functions.
Definition in file host_interface_service.c.
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().
comm_interface_t commUART |
Definition at line 92 of file comm_if_uart.c.
Referenced by HOST_Initialize().