Macros | Functions
dn_device.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 dependency graph for dn_device.c:

Go to the source code of this file.

Macros

#define __LITTLE_ENDIAN__
 
#define _PARA_MAX_COM   (7)
 
#define _PARA_MAX_ETH   (5)
 
#define _STR_ISNUMERIC   "0123456789"
 
#define _TYPE_MIN   (3)
 

Functions

HRESULT check_conn_param (const struct CONN_PARAM_COMMON *device, int flag)
 Checks the communication parameters. More...
 
HRESULT check_timeout (int sock, uint32_t timeout)
 Checks the communication timeout. More...
 
static int is_numeric (const char *src)
 Checks the argument is numeric or not. More...
 
void memcpy_be (void *dst, const void *src, uint32_t len)
 Orders to big endian. More...
 
void memcpy_le (void *dst, const void *src, uint32_t len)
 Orders to little endian. More...
 
HRESULT parse_conn_param_ether (const char *opt, struct CONN_PARAM_ETH *param)
 Parses Ethernet connection parameters. More...
 
HRESULT parse_conn_param_serial (const char *opt, struct CONN_PARAM_COM *param)
 Parses serial connection parameters. More...
 
int parse_conn_type (const char *opt)
 Parses and returns the connection type. More...
 

Macro Definition Documentation

#define __LITTLE_ENDIAN__

Definition at line 56 of file dn_device.c.

#define _PARA_MAX_COM   (7)

Definition at line 49 of file dn_device.c.

#define _PARA_MAX_ETH   (5)

Definition at line 50 of file dn_device.c.

#define _STR_ISNUMERIC   "0123456789"

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 46 of file dn_device.c.

#define _TYPE_MIN   (3)

Definition at line 48 of file dn_device.c.

Function Documentation

HRESULT check_conn_param ( const struct CONN_PARAM_COMMON device,
int  flag 
)

Checks the communication parameters.

Parameters
[in]deviceCommunication parameters to be checked.
[in]flagFlags to be checked with CONN_PARAM_CHECK_FLAG.

Definition at line 419 of file dn_device.c.

HRESULT check_timeout ( int  sock,
uint32_t  timeout 
)

Checks the communication timeout.

Parameters
[in]sockFile descriptor to be checked.
[in]timeoutTimeout value.

Definition at line 385 of file dn_device.c.

int is_numeric ( const char *  src)
static

Checks the argument is numeric or not.

Parameters
[in]srcThe characters to be checked.

Definition at line 69 of file dn_device.c.

void memcpy_be ( void *  dst,
const void *  src,
uint32_t  len 
)

Orders to big endian.

Parameters
[out]dstThe pointer of ordered variable.
[in]srcThe pointer of variable to be ordered.
[in]lenThe number of buffers to be ordered.

Definition at line 495 of file dn_device.c.

void memcpy_le ( void *  dst,
const void *  src,
uint32_t  len 
)

Orders to little endian.

Parameters
[out]dstThe pointer of ordered variable.
[in]srcThe pointer of variable to be ordered.
[in]lenThe number of buffers to be ordered.

Definition at line 469 of file dn_device.c.

HRESULT parse_conn_param_ether ( const char *  opt,
struct CONN_PARAM_ETH param 
)

Parses Ethernet connection parameters.

Parameters
[in]optConnection option string.
[out]paramParsed Ethernet connection parameters.
Note
tcp[:<DestIP>[:<DestPort>[:<SourceIP>[:<SourcePort>]]]]
udp[:<DestIP>[:<DestPort>[:<SourceIP>[:<SourcePort>]]]]

Definition at line 121 of file dn_device.c.

HRESULT parse_conn_param_serial ( const char *  opt,
struct CONN_PARAM_COM param 
)

Parses serial connection parameters.

Parameters
[in]optConnection option string.
[out]paramParsed serial connection parameters.
Note
com[:<COM port>="">[:<BaudRate>[:<Parity>:<DataBits>:<StopBits>[:<Flow>]]]
<COM port>=""> := 0, 1, ...
<BaudRate> := 50, 75, ...
<Parity> := N, O, E
<DataBits> := 5, 6, 7, 8
<StopBits> := 1, 2
<Flow> := 0, 1, 2, 3

Definition at line 235 of file dn_device.c.

int parse_conn_type ( const char *  opt)

Parses and returns the connection type.

Parameters
[in]optConnection option string.

Definition at line 93 of file dn_device.c.



bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Mon Jun 10 2019 13:12:20