![]() |
botsense
3.2.0
RoadNarrows Client-Server Proxied Services Framework
|
BotSense bsProxy client proxied I2C bus device library. More...
#include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#include <string.h>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "rnr/netmsgs.h"
#include "rnr/i2c.h"
#include "botsense/BotSense.h"
#include "botsense/libBotSense.h"
#include "botsense/bsI2C.h"
#include "botsense/bsI2CMsgs.h"
Go to the source code of this file.
Functions | |
const char * | bsI2CGetMsgName (BsClient_P pClient, BsVConnHnd_T hndVConn, uint_t uMsgId) |
Get the I2C message name. More... | |
int | bsI2CReqOpen (BsClient_P pClient, const char *sDevName, bool_t bInitTrace) |
Request proxy server to establish a virtual connection to an I2C bus device. More... | |
int | bsI2CReqClose (BsClient_P pClient, BsVConnHnd_T hndVConn) |
Request proxy server to close client's proxied I2C device vitual connection. More... | |
int | bsI2CReqRead (BsClient_P pClient, BsVConnHnd_T hndVConn, i2c_addr_t i2cAddr, size_t uReadLen, byte_t rbuf[]) |
Proxied request to read from a device attached to the I2C bus. More... | |
int | bsI2CReqWrite (BsClient_P pClient, BsVConnHnd_T hndVConn, i2c_addr_t i2cAddr, byte_t wbuf[], size_t uWriteLen) |
Proxied request to write to a device attached to the I2C bus. More... | |
int | bsI2CReqTrans (BsClient_P pClient, BsVConnHnd_T hndVConn, i2c_addr_t i2cAddr, byte_t wbuf[], size_t uWriteLen, size_t uReadLen, byte_t rbuf[]) |
Proxied request to execute a write-read transaction to a device attached to the I2C bus. More... | |
int | bsI2CReqScan (BsClient_P pClient, BsVConnHnd_T hndVConn, i2c_addr_t bufScan[], size_t sizeScanBuf) |
Proxied request to scan the I2C bus for all attached devices. More... | |
Variables | |
static BsClientAppInfo_T | bsI2CAppInfo |
BotSense client application information. More... | |
BotSense bsProxy client proxied I2C bus device library.
Definition in file bsI2CClient.c.
const char* bsI2CGetMsgName | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
uint_t | uMsgId | ||
) |
Get the I2C message name.
For each (virtual connection, message id) 2-tuple, there can be a known name string (provided the id is valid and an application provides the information).
pClient |
Definition at line 101 of file bsI2CClient.c.
References BsI2CLookupMsgDef().
int bsI2CReqClose | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn | ||
) |
Request proxy server to close client's proxied I2C device vitual connection.
pClient |
Definition at line 153 of file bsI2CClient.c.
int bsI2CReqOpen | ( | BsClient_P | pClient, |
const char * | sDevName, | ||
bool_t | bInitTrace | ||
) |
Request proxy server to establish a virtual connection to an I2C bus device.
pClient |
Definition at line 124 of file bsI2CClient.c.
References BS_I2C_SERVER_MOD, and BSCLIENT_TRY_ECODE.
int bsI2CReqRead | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
i2c_addr_t | i2cAddr, | ||
size_t | uReadLen, | ||
byte_t | rbuf[] | ||
) |
Proxied request to read from a device attached to the I2C bus.
pClient |
Definition at line 171 of file bsI2CClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSI2C_RSPREAD_READBUF_LEN, BsI2CMsgIdReqRead, BsI2CMsgIdRspRead, BsI2CPackReqRead(), BsI2CUnpackRspRead(), BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BsI2CReqRead_T::m_addr, BsI2CRspRead_T::m_count, BsI2CRspRead_T::m_readbuf, BsI2CReqRead_T::m_readlen, and BsI2CRspRead_T::u.
int bsI2CReqScan | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
i2c_addr_t | bufScan[], | ||
size_t | sizeScanBuf | ||
) |
Proxied request to scan the I2C bus for all attached devices.
pClient |
Definition at line 433 of file bsI2CClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BsI2CMsgIdReqScan, BsI2CMsgIdRspScan, BsI2CUnpackRspScan(), BSPROXY_MSG_MAX_LEN, BsI2CRspScan_T::m_count, BsI2CRspScan_T::m_scan, and BsI2CRspScan_T::u.
int bsI2CReqTrans | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
i2c_addr_t | i2cAddr, | ||
byte_t | wbuf[], | ||
size_t | uWriteLen, | ||
size_t | uReadLen, | ||
byte_t | rbuf[] | ||
) |
Proxied request to execute a write-read transaction to a device attached to the I2C bus.
pClient |
Definition at line 340 of file bsI2CClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSI2C_REQTRANS_WRITEBUF_LEN, BSI2C_RSPREAD_READBUF_LEN, BsI2CMsgIdReqTrans, BsI2CMsgIdRspRead, BsI2CPackReqTrans(), BsI2CUnpackRspRead(), BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BsI2CReqTrans_T::m_addr, BsI2CReqTrans_T::m_count, BsI2CRspRead_T::m_count, BsI2CRspRead_T::m_readbuf, BsI2CReqTrans_T::m_readlen, BsI2CReqTrans_T::m_writebuf, BsI2CReqTrans_T::u, and BsI2CRspRead_T::u.
int bsI2CReqWrite | ( | BsClient_P | pClient, |
BsVConnHnd_T | hndVConn, | ||
i2c_addr_t | i2cAddr, | ||
byte_t | wbuf[], | ||
size_t | uWriteLen | ||
) |
Proxied request to write to a device attached to the I2C bus.
pClient |
Definition at line 256 of file bsI2CClient.c.
References BS_ECODE_BAD_VAL, BSCLIENT_HAS_VCONN, BSCLIENT_TRY_ECODE, BSCLIENT_TRY_EXPR, BSCLIENT_TRY_NM_ECODE, BSI2C_REQWRITE_WRITEBUF_LEN, BsI2CMsgIdReqWrite, BsI2CMsgIdRspWrite, BsI2CPackReqWrite(), BsI2CUnpackRspWrite(), BSPROXY_BUF_BODY, BSPROXY_MSG_MAX_LEN, BsI2CReqWrite_T::m_addr, BsI2CRspWrite_T::m_byteswritten, BsI2CReqWrite_T::m_count, BsI2CReqWrite_T::m_writebuf, and BsI2CReqWrite_T::u.
|
static |
BotSense client application information.
Definition at line 71 of file bsI2CClient.c.