Classes | Defines | Typedefs | Functions | Variables
b-Cap.c File Reference

b-CAP client library More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <fcntl.h>
#include <termios.h>
#include "b-Cap.h"
Include dependency graph for b-Cap.c:

Go to the source code of this file.

Classes

struct  BCAP_ARG
 BCAP_ARG. More...
struct  BCAP_PACKET
 BCAP_PACKET. More...

Defines

#define __LITTLE_ENDIAN__
#define BCAP_EOT   0x04 /* size of packet terminater(EOT) */
#define BCAP_FUNC_Controller_Connect   3
#define BCAP_FUNC_Controller_Disconnect   4
#define BCAP_FUNC_Controller_Execute   17
#define BCAP_FUNC_Controller_GetRobot   7
#define BCAP_FUNC_Controller_GetTask   8
#define BCAP_FUNC_Controller_GetVariable   9
#define BCAP_FUNC_Robot_Change   66
#define BCAP_FUNC_Robot_Execute   64
#define BCAP_FUNC_Robot_GetVariable   62
#define BCAP_FUNC_Robot_Move   72
#define BCAP_FUNC_Robot_Release   84
#define BCAP_FUNC_Service_Start   1
#define BCAP_FUNC_Service_Stop   2
#define BCAP_FUNC_Task_GetVariable   85
#define BCAP_FUNC_Task_Release   99
#define BCAP_FUNC_Task_Start   88
#define BCAP_FUNC_Task_Stop   89
#define BCAP_FUNC_Variable_GetValue   101
#define BCAP_FUNC_Variable_PutValue   102
#define BCAP_FUNC_Variable_PutValue   102
#define BCAP_FUNC_Variable_Release   111
#define BCAP_MAX_ARG_SIZE   0x1000000 /* max arg size (bytes) */
#define BCAP_MAX_PACKET_SIZE   0x1000000 /* max packet size (bytes) */
#define BCAP_SIZE_ARGARRAYS   4 /* size of arrays */
#define BCAP_SIZE_ARGBASE   (BCAP_SIZE_ARGLEN+BCAP_SIZE_ARGTYPE+BCAP_SIZE_ARGARRAYS)
#define BCAP_SIZE_ARGLEN   4 /* size of length */
#define BCAP_SIZE_ARGNUM   2 /* size of Args */
#define BCAP_SIZE_ARGSTRLEN   4 /* size of string length */
#define BCAP_SIZE_ARGTYPE   2 /* size of type */
#define BCAP_SIZE_BASE
#define BCAP_SIZE_CRC   2 /* size of CRC */
#define BCAP_SIZE_EOT   1 /* size of terminater(EOT) */
#define BCAP_SIZE_FUNCID   4 /* size of FunctionID */
#define BCAP_SIZE_LEN   4 /* size of message size */
#define BCAP_SIZE_RESERVE   2 /* size of reserved */
#define BCAP_SIZE_SERIAL   2 /* size of serial number */
#define BCAP_SIZE_SOH   1 /* size of header(SOH) */
#define BCAP_SOH   0x01 /* size of packet header(SOH) */
#define DebugPrint(message)
#define DebugPrint2(f, a, b)
#define LOCALBUFFER_SZ   1024
#define LOCALRECBUFFER_SZ   1024

Typedefs

typedef struct BCAP_ARG BCAP_ARG
typedef struct BCAP_PACKET BCAP_PACKET

Functions

static BCAP_ARGArg_Create (u_short iType, u_int lArrays, u_int lLength, void *data)
static void Arg_Release (BCAP_ARG *pArg)
BCAP_HRESULT bCap_Open (const char *pIPStr, int iPort, int *iSockFd)
static BCAP_HRESULT bCapSendAndRec (int iSockFd, BCAP_PACKET *pSndPacket, BCAP_PACKET *pRecPacket)
static void bFree (void *pPtr)
static void * bMalloc (size_t size)
static u_int copyFromBSTR (void *pDstAsciiPtr, void *pSrcBstrPtr)
static u_int copyToBSTR (void *pbDstPtr, void *pbSrcPtr)
static u_int copyValue (void *pDst, void *pVntValue, u_int lLength)
static u_int copyVariantFromArg (BCAP_VARIANT *pVntDst, BCAP_ARG *pArg)
static BCAP_HRESULT Packet_AddArg (BCAP_PACKET *pPacket, BCAP_ARG *pNewArg)
static BCAP_PACKETPacket_Create (u_int lFuncID)
static BCAP_HRESULT Packet_Deserialize (void *pBinData, BCAP_PACKET *pPacket)
static BCAP_HRESULT Packet_GetResult (BCAP_PACKET *pRecPacket, void *pResult)
static void Packet_Release (BCAP_PACKET *pPacket)
static BCAP_HRESULT Packet_Send (int iSd, BCAP_PACKET *pPacket)
static BCAP_HRESULT Packet_Serialize (BCAP_PACKET *pPacket, void *pBinData)
static u_char * receivePacket (int iSockFd, int *retryp)
static BCAP_HRESULT sendBinary (int iSockFd, u_char *pBuff, u_int lSize)
static u_int sizeOfVariant (BCAP_VARIANT vntValue)
static u_int sizeOfVarType (u_short iType)

Variables

static u_short m_iSerialNo = 1

Detailed Description

b-CAP client library

Version:
1.2
Date:
2012/12/10
Author:
DENSO WAVE (y)

Definition in file b-Cap.c.


Define Documentation

Definition at line 50 of file b-Cap.c.

#define BCAP_EOT   0x04 /* size of packet terminater(EOT) */

Definition at line 80 of file b-Cap.c.

Definition at line 113 of file b-Cap.c.

Definition at line 114 of file b-Cap.c.

Definition at line 118 of file b-Cap.c.

Definition at line 115 of file b-Cap.c.

Definition at line 116 of file b-Cap.c.

Definition at line 117 of file b-Cap.c.

#define BCAP_FUNC_Robot_Change   66

Definition at line 122 of file b-Cap.c.

#define BCAP_FUNC_Robot_Execute   64

Definition at line 121 of file b-Cap.c.

#define BCAP_FUNC_Robot_GetVariable   62

Definition at line 120 of file b-Cap.c.

#define BCAP_FUNC_Robot_Move   72

Definition at line 123 of file b-Cap.c.

#define BCAP_FUNC_Robot_Release   84

Definition at line 124 of file b-Cap.c.

#define BCAP_FUNC_Service_Start   1

Definition at line 111 of file b-Cap.c.

#define BCAP_FUNC_Service_Stop   2

Definition at line 112 of file b-Cap.c.

#define BCAP_FUNC_Task_GetVariable   85

Definition at line 126 of file b-Cap.c.

#define BCAP_FUNC_Task_Release   99

Definition at line 129 of file b-Cap.c.

#define BCAP_FUNC_Task_Start   88

Definition at line 127 of file b-Cap.c.

#define BCAP_FUNC_Task_Stop   89

Definition at line 128 of file b-Cap.c.

#define BCAP_FUNC_Variable_GetValue   101

Definition at line 132 of file b-Cap.c.

#define BCAP_FUNC_Variable_PutValue   102

Definition at line 133 of file b-Cap.c.

#define BCAP_FUNC_Variable_PutValue   102

Definition at line 133 of file b-Cap.c.

#define BCAP_FUNC_Variable_Release   111

Definition at line 134 of file b-Cap.c.

#define BCAP_MAX_ARG_SIZE   0x1000000 /* max arg size (bytes) */

Definition at line 107 of file b-Cap.c.

#define BCAP_MAX_PACKET_SIZE   0x1000000 /* max packet size (bytes) */

Definition at line 106 of file b-Cap.c.

#define BCAP_SIZE_ARGARRAYS   4 /* size of arrays */

Definition at line 100 of file b-Cap.c.

Definition at line 101 of file b-Cap.c.

#define BCAP_SIZE_ARGLEN   4 /* size of length */

Definition at line 98 of file b-Cap.c.

#define BCAP_SIZE_ARGNUM   2 /* size of Args */

Definition at line 87 of file b-Cap.c.

#define BCAP_SIZE_ARGSTRLEN   4 /* size of string length */

Definition at line 103 of file b-Cap.c.

#define BCAP_SIZE_ARGTYPE   2 /* size of type */

Definition at line 99 of file b-Cap.c.

#define BCAP_SIZE_BASE
Value:
(BCAP_SIZE_SOH + BCAP_SIZE_EOT + \
                                                                 BCAP_SIZE_LEN + BCAP_SIZE_SERIAL + \
                                                                 BCAP_SIZE_RESERVE + BCAP_SIZE_FUNCID + \
                                                                 BCAP_SIZE_ARGNUM)

Definition at line 91 of file b-Cap.c.

#define BCAP_SIZE_CRC   2 /* size of CRC */

Definition at line 88 of file b-Cap.c.

#define BCAP_SIZE_EOT   1 /* size of terminater(EOT) */

Definition at line 82 of file b-Cap.c.

#define BCAP_SIZE_FUNCID   4 /* size of FunctionID */

Definition at line 86 of file b-Cap.c.

#define BCAP_SIZE_LEN   4 /* size of message size */

Definition at line 83 of file b-Cap.c.

#define BCAP_SIZE_RESERVE   2 /* size of reserved */

Definition at line 85 of file b-Cap.c.

#define BCAP_SIZE_SERIAL   2 /* size of serial number */

Definition at line 84 of file b-Cap.c.

#define BCAP_SIZE_SOH   1 /* size of header(SOH) */

Definition at line 81 of file b-Cap.c.

#define BCAP_SOH   0x01 /* size of packet header(SOH) */

Definition at line 79 of file b-Cap.c.

#define DebugPrint (   message)

Definition at line 65 of file b-Cap.c.

#define DebugPrint2 (   f,
  a,
 
)

Definition at line 66 of file b-Cap.c.

#define LOCALBUFFER_SZ   1024

Definition at line 73 of file b-Cap.c.

#define LOCALRECBUFFER_SZ   1024

Definition at line 75 of file b-Cap.c.


Typedef Documentation

typedef struct BCAP_ARG BCAP_ARG
typedef struct BCAP_PACKET BCAP_PACKET

Function Documentation

static BCAP_ARG* Arg_Create ( u_short  iType,
u_int  lArrays,
u_int  lLength,
void *  data 
) [static]
static void Arg_Release ( BCAP_ARG pArg) [static]
BCAP_HRESULT bCap_Open ( const char *  pIPStr,
int  iPort,
int *  iSockFd 
)

Init and Open socket

Init and Open socket

Parameters:
iSockFd: [in] Socket descriptor
Return values:
BCAP_HRESULT

Definition at line 225 of file b-Cap.c.

static BCAP_HRESULT bCapSendAndRec ( int  iSockFd,
BCAP_PACKET pSndPacket,
BCAP_PACKET pRecPacket 
) [static]
static void bFree ( void *  pPtr) [static]
static void* bMalloc ( size_t  size) [static]
static u_int copyFromBSTR ( void *  pDstAsciiPtr,
void *  pSrcBstrPtr 
) [static]
static u_int copyToBSTR ( void *  pbDstPtr,
void *  pbSrcPtr 
) [static]
static u_int copyValue ( void *  pDst,
void *  pVntValue,
u_int  lLength 
) [static]
static u_int copyVariantFromArg ( BCAP_VARIANT *  pVntDst,
BCAP_ARG pArg 
) [static]
static BCAP_HRESULT Packet_AddArg ( BCAP_PACKET pPacket,
BCAP_ARG pNewArg 
) [static]
static BCAP_PACKET* Packet_Create ( u_int  lFuncID) [static]
static BCAP_HRESULT Packet_Deserialize ( void *  pBinData,
BCAP_PACKET pPacket 
) [static]
static BCAP_HRESULT Packet_GetResult ( BCAP_PACKET pRecPacket,
void *  pResult 
) [static]
static void Packet_Release ( BCAP_PACKET pPacket) [static]
static BCAP_HRESULT Packet_Send ( int  iSd,
BCAP_PACKET pPacket 
) [static]
static BCAP_HRESULT Packet_Serialize ( BCAP_PACKET pPacket,
void *  pBinData 
) [static]
static u_char* receivePacket ( int  iSockFd,
int *  retryp 
) [static]
static BCAP_HRESULT sendBinary ( int  iSockFd,
u_char *  pBuff,
u_int  lSize 
) [static]
static u_int sizeOfVariant ( BCAP_VARIANT  vntValue) [static]
static u_int sizeOfVarType ( u_short  iType) [static]

Variable Documentation

u_short m_iSerialNo = 1 [static]

Definition at line 206 of file b-Cap.c.



denso_controller
Author(s): Ryohei Ueda
autogenerated on Thu Jun 6 2019 20:15:20