ISSDK  1.8
IoT Sensing Software Development Kit
Functions | Variables
host_interface_service.c File Reference

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"
Include dependency graph for host_interface_service.c:

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
 

Detailed Description

The dhost_interface_servicec file implements host interface functions.

Definition in file host_interface_service.c.

Function Documentation

◆ HOST_Configure()

int32_t HOST_Configure ( host_interface_handle_t pHandle,
void *  pConfigData 
)

The function to Configure the Host.

TBD

Parameters
[in]pHandle- pointer to the interface handle
[in]pConfigData- Host configuration information
Returns
HOST_Configure() returns the status .
Constraints:
None
Reentrant: Yes

Definition at line 49 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HOST_Initialize()

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.

Parameters
[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
Returns
HOST_Initialize() returns the status .
Constraints:
None
Reentrant: Yes

Definition at line 26 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HOST_Receive()

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.

Parameters
[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.
Returns
HOST_Receive() returns the status .
Constraints:
None
Reentrant: Yes

Definition at line 67 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HOST_Send()

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

Parameters
[in]pHandle- pointer to the interface handle
[in]pData- pointer to a data to send
[in]size- number of byte to send
Returns
HOST_Send() returns the status .
Constraints:
None
Reentrant: Yes

Definition at line 58 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().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ commUART

comm_interface_t commUART

Definition at line 66 of file comm_if_uart.c.

Referenced by HOST_Initialize().