Defines | Functions
bcap_common.c File Reference
#include "stdint.h"
#include <stdlib.h>
#include <string.h>
#include "dn_additional.h"
#include "dn_common.h"
#include "dn_device.h"
#include "dn_udp.h"
#include "bcap_common.h"
Include dependency graph for bcap_common.c:

Go to the source code of this file.

Defines

#define _SEC_ONEDAY   (24 * 60 * 60)
 A definition for the second of one day.
#define _TIME_DIFFERENCE   (25569.0)
 A definition for the time difference between time_t(0) and DATE(0).

Functions

HRESULT bcap_bytary2packet (const char *src, uint32_t len_src, struct BCAP_PACKET *dst)
 Converts the byte array to a b-CAP packet.
static HRESULT bcap_bytary2vnt (const char *src, uint32_t len_src, VARIANT *dst, uint32_t argc, uint32_t *offset)
 Converts the byte array to a VARIANT value.
static HRESULT bcap_bytary2vntary (const char *src, uint32_t len_src, VARIANT *dst, uint32_t argc, uint32_t *offset, int flag)
 Converts the byte array to a VARIANT array.
static void bcap_bytary2vntdate (const char *src, DATE *dst)
 Converts the byte array to a DATE value.
uint16_t bcap_calc_crc (uint8_t *buf, uint32_t len_buf)
 Calculates CRC of the b-CAP packet.
uint32_t bcap_calc_size_packet (const struct BCAP_PACKET *packet)
 Calculates the converted buffer size of the b-CAP packet.
static uint32_t bcap_calc_size_variant (const VARIANT *vnt)
 Calculates the buffer length of the VARIANT.
HRESULT bcap_packet2bytary (const struct BCAP_PACKET *src, char *dst, uint32_t len_dst)
 Converts the b-CAP packet to a byte array.
HRESULT bcap_recv (struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_recv, int client)
 Receives b-CAP packet.
HRESULT bcap_send (struct CONN_PARAM_COMMON *device, struct BCAP_PACKET *packet_send)
 Sends b-CAP packet.
static HRESULT bcap_vnt2bytary (const VARIANT *src, uint32_t argc, char *dst, uint32_t len_dst, uint32_t *offset)
static HRESULT bcap_vntary2bytary (const VARIANT *src, uint32_t argc, char *dst, uint32_t len_dst, uint32_t *offset, int flag)
static void bcap_vntdate2bytary (const DATE *src, char *dst)
 Converts the DATE value to a byte array.

Define Documentation

#define _SEC_ONEDAY   (24 * 60 * 60)

A definition for the second of one day.

Definition at line 48 of file bcap_common.c.

#define _TIME_DIFFERENCE   (25569.0)

A definition for the time difference between time_t(0) and DATE(0).

Software License Agreement (MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition at line 42 of file bcap_common.c.


Function Documentation

HRESULT bcap_bytary2packet ( const char *  src,
uint32_t  len_src,
struct BCAP_PACKET dst 
)

Converts the byte array to a b-CAP packet.

Parameters:
[in]srcThe byte array to be converted.
[in]len_srcThe length of allocated byte array.
[out]dstThe converted b-CAP packet.
Note:
If you want to be allocated args by system, then sets argc = -1 and args = NULL.

Definition at line 776 of file bcap_common.c.

HRESULT bcap_bytary2vnt ( const char *  src,
uint32_t  len_src,
VARIANT dst,
uint32_t  argc,
uint32_t offset 
) [static]

Converts the byte array to a VARIANT value.

Parameters:
[in]srcThe byte array to be converted.
[in]len_srcThe length of allocated byte array.
[out]dstThe converted VARIANT value.
[in]argcThe number of arrays.
[in,out]offsetThe current buffer position to convert.

Definition at line 528 of file bcap_common.c.

static HRESULT bcap_bytary2vntary ( const char *  src,
uint32_t  len_src,
VARIANT dst,
uint32_t  argc,
uint32_t offset,
int  flag 
) [static]

Converts the byte array to a VARIANT array.

Parameters:
[in]srcThe byte array to be converted.
[in]len_srcThe length of allocated byte array.
[out]dstThe converted VARIANT array.
[in]argcThe number of arrays.
[in,out]offsetThe current buffer position to convert.
[in]flagFlag that means whether this function called from bcap_bytary2packet or not.

Definition at line 732 of file bcap_common.c.

void bcap_bytary2vntdate ( const char *  src,
DATE dst 
) [static]

Converts the byte array to a DATE value.

Parameters:
[in]srcThe byte array to be converted.
[out]dstThe converted DATE value.

Definition at line 196 of file bcap_common.c.

uint16_t bcap_calc_crc ( uint8_t buf,
uint32_t  len_buf 
)

Calculates CRC of the b-CAP packet.

Parameters:
[in]packetThe b-CAP packet to be calculated.

Definition at line 870 of file bcap_common.c.

uint32_t bcap_calc_size_packet ( const struct BCAP_PACKET packet)

Calculates the converted buffer size of the b-CAP packet.

Parameters:
[in]packetThe b-CAP packet to be calculated.

Definition at line 847 of file bcap_common.c.

uint32_t bcap_calc_size_variant ( const VARIANT vnt) [static]

Calculates the buffer length of the VARIANT.

Parameters:
[in]vntThe VARIANT value to be calculated.

Definition at line 70 of file bcap_common.c.

HRESULT bcap_packet2bytary ( const struct BCAP_PACKET src,
char *  dst,
uint32_t  len_dst 
)

Converts the b-CAP packet to a byte array.

Parameters:
[in]srcThe b-CAP packet to be converted.
[out]dstThe converted byte array.
[in]len_dstThe length of allocated byte array.

Definition at line 476 of file bcap_common.c.

HRESULT bcap_recv ( struct CONN_PARAM_COMMON device,
struct BCAP_PACKET packet_recv,
int  client 
)

Receives b-CAP packet.

Parameters:
[in]deviceThe common communication parameters.
[out]packet_recvThe b-CAP packet to be received.
[in]clientFlag that means the receiver is client(1) or not(0).

Definition at line 984 of file bcap_common.c.

HRESULT bcap_send ( struct CONN_PARAM_COMMON device,
struct BCAP_PACKET packet_send 
)

Sends b-CAP packet.

Parameters:
[in]deviceThe common communication parameters.
[in]packet_sendThe b-CAP packet to be sent.

Definition at line 899 of file bcap_common.c.

static HRESULT bcap_vnt2bytary ( const VARIANT src,
uint32_t  argc,
char *  dst,
uint32_t  len_dst,
uint32_t offset 
) [static]

Definition at line 219 of file bcap_common.c.

static HRESULT bcap_vntary2bytary ( const VARIANT src,
uint32_t  argc,
char *  dst,
uint32_t  len_dst,
uint32_t offset,
int  flag 
) [static]

Definition at line 415 of file bcap_common.c.

void bcap_vntdate2bytary ( const DATE src,
char *  dst 
) [static]

Converts the DATE value to a byte array.

Parameters:
[in]srcThe DATE value to be converted.
[out]dstThe converted byte array.

Definition at line 176 of file bcap_common.c.



bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Thu Jun 6 2019 21:00:03