NXP Reader Library  v17.1.0.2535
Bus Abstraction Layer

Contains Communication-Independent implementations of various hardwares. More...

Collaboration diagram for Bus Abstraction Layer:

Modules

 Component : PCSC (Windows)
 PC/SC BAL Windows.
 
 Component : Pipe (Linux)
 Pipe BAL (Unix/Linux)
 
 Component : Rd70x USB (Windows)
 Rd70x BAL (Windows)
 
 Component : Rd710 SAM
 Rd710 SAM BAL.
 
 Component : SAM
 To communicate to SAM using Pegoda Reader or DUT readers.
 
 Component : RS232 (Windows)
 RS232 BAL (Windows)
 
 Component : Socket (Windows)
 Socket BAL (Windows)
 
 Component : Stub
 Component without functionality to ease implementation of additional busses.
 
 Component : MP300USB
 
 Component : Ps6000Usb
 BAL-Component for the PicoScope PS6000 USB Oscilloscope.
 

Functions

phStatus_t phbalReg_GetPortList (void *pDataParams, uint16_t wPortBufSize, uint8_t *pPortNames, uint16_t *pNumOfPorts)
 List all available ports. More...
 
phStatus_t phbalReg_SetPort (void *pDataParams, uint8_t *pPortName)
 Select Port to be used. More...
 
phStatus_t phbalReg_OpenPort (void *pDataParams)
 Open communication port. More...
 
phStatus_t phbalReg_ClosePort (void *pDataParams)
 Close communication port. More...
 
phStatus_t phbalReg_Exchange (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint16_t wRxBufSize, uint8_t *pRxBuffer, uint16_t *pRxLength)
 Perform Data Exchange on the bus. More...
 
phStatus_t phbalReg_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Set configuration parameter. More...
 
phStatus_t phbalReg_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Get configuration parameter. More...
 

Generic BAL Configs

#define PHBAL_REG_CONFIG_WRITE_TIMEOUT_MS   0x0000U
 Configure transmission timeout.
 
#define PHBAL_REG_CONFIG_READ_TIMEOUT_MS   0x0001U
 Configure reception timeout.
 

Custom Error Codes

#define PHBAL_REG_ERR_DLL   (PH_ERR_CUSTOM_BEGIN + 0)
 used dll threw an non standard error read wAddionalInfo to get error code
 

Detailed Description

Contains Communication-Independent implementations of various hardwares.

These Components implement the interfaces between physical Host-Device and physical Reader-Device.

Function Documentation

◆ phbalReg_GetPortList()

phStatus_t phbalReg_GetPortList ( void *  pDataParams,
uint16_t  wPortBufSize,
uint8_t pPortNames,
uint16_t pNumOfPorts 
)

List all available ports.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_BUFFER_OVERFLOWGiven enumeration buffer is too small.
PH_ERR_INTERFACE_ERRORError while enumerating devices.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wPortBufSize[In] Buffer Size of Port Name String.
[out]pPortNames[Out] Port Name as Multi-String.
[out]pNumOfPorts[Out] Number of found port strings.

◆ phbalReg_SetPort()

phStatus_t phbalReg_SetPort ( void *  pDataParams,
uint8_t pPortName 
)

Select Port to be used.

Note
The caller has to ensure that pPortName is valid throughout the whole lifetime of pDataParams.
Furthermore, the caller is responsible for prepending \\.\ escape format if COM ports above COM9 need to be accessed.

Example:

strcpy(pPortName, "COM9"); <-- correct
strcpy(pPortName, "\\\\.\\COM9"); <-- correct
strcpy(pPortName, "\\\\.\\COM10"); <-- correct
strcpy(pPortName, "COM10"); <-- wrong
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pPortName[In] Port Name as String.

◆ phbalReg_OpenPort()

phStatus_t phbalReg_OpenPort ( void *  pDataParams)

Open communication port.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_USE_CONDITIONCommunication port is already open.
PH_ERR_INTERFACE_ERRORError while opening port.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phbalReg_ClosePort()

phStatus_t phbalReg_ClosePort ( void *  pDataParams)

Close communication port.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_USE_CONDITIONCommunication port is not open.
PH_ERR_INTERFACE_ERRORError while closing port.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.

◆ phbalReg_Exchange()

phStatus_t phbalReg_Exchange ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint16_t  wRxBufSize,
uint8_t pRxBuffer,
uint16_t pRxLength 
)

Perform Data Exchange on the bus.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERwOption is invalid.
PH_ERR_IO_TIMEOUTNo response received within given time frame.
PH_ERR_BUFFER_OVERFLOWResponse is too big for either given receive buffer or internal buffer.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter.
[in]pTxBuffer[In] Data to transmit.
[in]wTxLength[In] Number of bytes to transmit.
[in]wRxBufSize[In] Size of receive buffer / Number of bytes to receive (depending on implementation).
[out]pRxBuffer[Out] Received data.
[out]pRxLength[Out] Number of received data bytes.

◆ phbalReg_SetConfig()

phStatus_t phbalReg_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Set configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INVALID_PARAMETERParameter value is invalid.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier.
[in]wValue[In] Configuration Value.

◆ phbalReg_GetConfig()

phStatus_t phbalReg_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Get configuration parameter.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INTERFACE_ERRORCommunication error.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration Identifier.
[out]pValue[Out] Configuration Value.