ISSDK  1.7
IoT Sensing Software Development Kit
Data Structures | Macros | Typedefs | Functions
host_interface_service.h File Reference

The host_interface_service.h file describes the structures and definitions for the host. More...

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "comm_interface.h"
Include dependency graph for host_interface_service.h:
This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

The host_interface_service.h file describes the structures and definitions for the host.

Definition in file host_interface_service.h.

Macro Definition Documentation

◆ HOST_INTERFACE_EVENT_RECEIVE_COMPLETE

#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.

◆ HOST_INTERFACE_EVENT_SEND_COMPLETE

#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.

◆ HOST_INTERFACE_OK

#define HOST_INTERFACE_OK   0

Definition at line 46 of file host_interface_service.h.

Referenced by HOST_Receive().

◆ HOST_INTERFACE_VERSION

#define HOST_INTERFACE_VERSION   ((1 << 4) | (0 & 0xF))

Definition at line 47 of file host_interface_service.h.

Referenced by Host_IO_Receive().

Typedef Documentation

◆ BlockRead_t

typedef void(* BlockRead_t) (host_interface_handle_t *pHandle, void *pData)

Definition at line 82 of file host_interface_service.h.

◆ Host_Event_t

typedef void(* Host_Event_t) (uint32_t event)

Definition at line 53 of file host_interface_service.h.

◆ host_interface_config_t

◆ host_interface_handle_t

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 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().

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 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().

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 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().

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 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().

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