anjay
Loading...
Searching...
No Matches
bg96_nidd.h File Reference
#include <anjay/core.h>
#include <anjay/nidd.h>

Go to the source code of this file.

Data Structures

struct  anjay_bg96_nidd_config_t
 

Typedefs

typedef int anjay_bg96_nidd_getline_t(void *user_context, char *out_line_buffer, size_t buffer_size, avs_time_monotonic_t deadline)
 
typedef int anjay_bg96_nidd_write_t(void *user_context, const char *buffer)
 
typedef int anjay_bg96_nidd_get_parameter_t(void *user_context, anjay_bg96_nidd_parameter_t parameter, char *out_value, size_t size)
 

Enumerations

enum  anjay_bg96_nidd_parameter_t { ANJAY_BG96_NIDD_APN , ANJAY_BG96_NIDD_USERNAME , ANJAY_BG96_NIDD_PASSWORD }
 

Functions

anjay_nidd_driver_tanjay_bg96_nidd_driver_create (const anjay_bg96_nidd_config_t *config)
 

Typedef Documentation

◆ anjay_bg96_nidd_get_parameter_t

typedef int anjay_bg96_nidd_get_parameter_t(void *user_context, anjay_bg96_nidd_parameter_t parameter, char *out_value, size_t size)

Obtains a NULL-terminated value of the specified parameter parameter.

Parameters
user_contextUser defined context to operate on.
parameterParameter to read.
out_valuePointer to a buffer, where a parameter value shall be stored.
sizeSize of the buffer.
Returns
0 on success, negative value if the parameter could not be obtained.

◆ anjay_bg96_nidd_getline_t

typedef int anjay_bg96_nidd_getline_t(void *user_context, char *out_line_buffer, size_t buffer_size, avs_time_monotonic_t deadline)

Returns a trimmed (that is, without leading or trailing whitespaces), nonempty and NULL-terminated line read from the modem.

Parameters
user_contextUser defined context to operate on.
out_line_bufferBuffer for the line.
buffer_sizeBuffer size in bytes.
deadlineDeadline of the entire operation.

IMPORTANT: Even if the deadline happens to be before the current monotonic time, this function MUST attempt to read a line at the current instant. In other words, at least an attempt to check if the line is available for reading must be made by this function no matter what the deadline is.

Returns
  • 0 on success (a full line has sucessfully been read)
  • ANJAY_BUFFER_TOO_SHORT if the buffer is not big enough to contain whole line + terminating nullbyte; out_line_buffer shall nevertheless be filled with as much data as was possible to receive in this case
  • negative value if any other error (including timeout) occurred.

◆ anjay_bg96_nidd_write_t

typedef int anjay_bg96_nidd_write_t(void *user_context, const char *buffer)

Writes a NULL-terminated line to the modem (excluding the NULL terminator).

Parameters
user_contextUser defined context to operate on.
bufferBufer whose contents shall be written.
Returns
0 on success, negative value in case of an error.

Enumeration Type Documentation

◆ anjay_bg96_nidd_parameter_t

Enumerator
ANJAY_BG96_NIDD_APN 
ANJAY_BG96_NIDD_USERNAME 
ANJAY_BG96_NIDD_PASSWORD 

Function Documentation

◆ anjay_bg96_nidd_driver_create()

anjay_nidd_driver_t * anjay_bg96_nidd_driver_create ( const anjay_bg96_nidd_config_t config)