#include "stdint.h"
#include <stdio.h>
#include <string.h>
#include "dn_additional.h"
#include "dn_common.h"
#include "dn_device.h"
#include "dn_com.h"
Go to the source code of this file.
Macros | |
#define | _COM_PORT_MAX (256) |
#define | _FLOW_HARDWARE (2) |
#define | _FLOW_XINOUT (1) |
Functions | |
HRESULT | com_clear (int sock, uint32_t timeout) |
Clears the received buffer. More... | |
HRESULT | com_close (int *sock) |
Closes the socket. More... | |
HRESULT | com_get_modem_state (int sock, uint32_t *state) |
Gets the serial port pin status. More... | |
HRESULT | com_get_state (int sock, COM_STATE *state) |
Gets the serial socket parameters. More... | |
HRESULT | com_open (void *param, int *sock) |
Opens serial port. More... | |
HRESULT | com_recv (int sock, char *buf, uint32_t len_buf, uint32_t *len_recved, uint32_t timeout, void *arg) |
Receives serial packet. More... | |
HRESULT | com_send (int sock, const char *buf, uint32_t len_buf, void *arg) |
Sends serial packet. More... | |
HRESULT | com_set_state (int sock, COM_STATE *state) |
Puts the serial socket parameters. More... | |
HRESULT | com_set_timeout (int sock, uint32_t timeout) |
Sets timeout value to the serial socket. More... | |
#define _COM_PORT_MAX (256) |
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.
HRESULT com_close | ( | int * | sock | ) |
HRESULT com_open | ( | void * | param, |
int * | sock | ||
) |
Opens serial port.
[in] | param | The pointer of serial connection parameters: CONN_PARAM_COM. |
[out] | sock | The created socket. |