Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cascoda-bm/cascoda_evbme.h"
#include "cascoda-bm/cascoda_interface.h"
#include "cascoda-bm/cascoda_serial.h"
#include "cascoda-bm/cascoda_types.h"
#include "cascoda-util/cascoda_time.h"
#include "openthread/cli.h"
#include "openthread/instance.h"
#include "openthread/link.h"
#include "openthread/thread.h"
#include "platform.h"
#include "lwip/dns.h"
#include "lwip/init.h"
#include "lwip/tcp.h"
#include "lwip-port.h"
Enumerations | |
enum | { DEMO_PORT = 51700 } |
Functions | |
err_t | demo_tcpconnected (void *arg, struct tcp_pcb *tpcb, err_t err) |
Callback triggered when TCP socket is connected. More... | |
void | demo_tcperr (void *arg, err_t err) |
Callback triggered when the TCP socket is disconnected unexpectedly. More... | |
void | demo_dnsfound (const char *name, const ip_addr_t *ipaddr, void *callback_arg) |
A callback triggered when a dns query is completed. More... | |
void | handle_cli_lwipdemo (void *aContext, uint8_t aArgsLength, char *aArgs[]) |
Process a CLI command to change the state of the lwip demo. More... | |
ca_error | init_lwipdemo (otInstance *aInstance, struct ca821x_dev *pDeviceRef) |
Initialise the lwip demo. More... | |
void demo_dnsfound | ( | const char * | name, |
const ip_addr_t * | ipaddr, | ||
void * | callback_arg | ||
) |
A callback triggered when a dns query is completed.
name | pointer to the name that was looked up. |
ipaddr | pointer to an ip_addr_t containing the IP address of the hostname, or NULL if the name could not be found (or on any other error). |
callback_arg | a user-specified callback argument passed to dns_gethostbyname |
Callback triggered when TCP socket is connected.
arg | unused |
tpcb | a pointer to the relevant socket |
err | the status of the connection |
void demo_tcperr | ( | void * | arg, |
err_t | err | ||
) |
Callback triggered when the TCP socket is disconnected unexpectedly.
arg | |
err |
void handle_cli_lwipdemo | ( | void * | aContext, |
uint8_t | aArgsLength, | ||
char * | aArgs[] | ||
) |
Process a CLI command to change the state of the lwip demo.
Should be linked to the openthread CLI using otCliSetUserCommands.
aContext | CLI Context |
aArgsLength | size of aArgs string array |
aArgs | array of arguments |
ca_error init_lwipdemo | ( | otInstance * | aInstance, |
struct ca821x_dev * | pDeviceRef | ||
) |
Initialise the lwip demo.
Should be called once at program startup.
aInstance | - Pointer to an OpenThread instance. |
pDeviceRef | - Pointer to initialised ca821x_device_ref struct. |