Skip to content

Commit

Permalink
FW-878. initial commit for socket layer + udp
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyClaeys committed Sep 24, 2020
1 parent 0fe9728 commit 654bdcf
Show file tree
Hide file tree
Showing 32 changed files with 1,100 additions and 921 deletions.
4 changes: 0 additions & 4 deletions bsp/boards/python/openwsnmodule_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "icmpv6rpl_obj.h"
#include "coap_obj.h"
#include "oscore_obj.h"
#include "udp_obj.h"
#include "idmanager_obj.h"
#include "openqueue_obj.h"
#include "openrandom_obj.h"
Expand All @@ -42,7 +41,6 @@
#include "cstorm_obj.h"
#include "cwellknown_obj.h"
#include "rrt_obj.h"
#include "uecho_obj.h"
#include "uinject_obj.h"
#include "userialbridge_obj.h"

Expand Down Expand Up @@ -206,7 +204,6 @@ struct OpenMote {
// l4
icmpv6echo_vars_t icmpv6echo_vars;
icmpv6rpl_vars_t icmpv6rpl_vars;
openudp_vars_t openudp_vars;
// l3
monitor_expiration_vars_t monitor_expiration_vars;
frag_vars_t frag_vars;
Expand Down Expand Up @@ -244,7 +241,6 @@ struct OpenMote {
cwellknown_vars_t cwellknown_vars;
rrt_vars_t rrt_vars;
cjoin_vars_t cjoin_vars;
uecho_vars_t uecho_vars;
uinject_vars_t uinject_vars;
userialbridge_vars_t userialbridge_vars;
};
Expand Down
25 changes: 20 additions & 5 deletions drivers/common/openserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ owerror_t openserial_printf(char *buffer, ...) {
#if BOARD_OPENSERIAL_PRINTF
uint8_t i;
char *ptr, *tmp;
char c;
void* p;
int d;
char intgr[16];
char buf[16];
char *fail = " - unknown format specifier - ";

uint8_t asn[5];
Expand All @@ -261,6 +263,10 @@ owerror_t openserial_printf(char *buffer, ...) {
if (*ptr == '%') {
ptr++;
switch (*ptr) {
case 'c':
c = va_arg(ap, int);
outputHdlcWrite(c);
break;
case 's':
tmp = va_arg(ap, char*);
while (*tmp != '\0'){
Expand All @@ -270,17 +276,26 @@ owerror_t openserial_printf(char *buffer, ...) {
break;
case 'd':
d = va_arg(ap, int);
snprintf(intgr, 16, "%d", d);
tmp = intgr;
snprintf(buf, 16, "%d", d);
tmp = buf;
while (*tmp != '\0'){
outputHdlcWrite(*tmp);
tmp++;
}
break;
case 'x':
d = va_arg(ap, int);
snprintf(intgr, 16, "%x", d);
tmp = intgr;
snprintf(buf, 16, "%x", d);
tmp = buf;
while (*tmp != '\0'){
outputHdlcWrite(*tmp);
tmp++;
}
break;
case 'p':
p = va_arg(ap, void*);
snprintf(buf, 16, "%p", p);
tmp = buf;
while (*tmp != '\0'){
outputHdlcWrite(*tmp);
tmp++;
Expand Down
1 change: 1 addition & 0 deletions inc/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Import('env')
localEnv = env.Clone()

sources_h = [
'af.h',
'config.h',
'check_config.h',
'opendefs.h',
Expand Down
24 changes: 24 additions & 0 deletions inc/af.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef OPENWSN_AF_H
#define OPENWSN_AF_H

/**
\brief Address families definitions
*/

enum {
AF_UNSPEC = 0, /**< unspecified address family */
#define AF_UNSPEC AF_UNSPEC /**< unspecified address family (as macro) */
AF_UNIX, /**< local to host (pipes, portals) address family. */
#define AF_UNIX AF_UNIX /**< unspecified address family (as macro) */
AF_PACKET, /**< packet family */
#define AF_PACKET AF_PACKET /**< packet family (as macro) */
AF_INET, /**< internetwork address family: UDP, TCP, etc. */
#define AF_INET AF_INET /**< internetwork address family: UDP, TCP, etc. (as macro) */
AF_INET6, /**< internetwork address family with IPv6: UDP, TCP, etc. */
#define AF_INET6 AF_INET6 /**< internetwork address family with IPv6: UDP, TCP, etc. (as macro) */
AF_NUMOF, /**< maximum number of address families on this system */
#define AF_NUMOF AF_NUMOF /**< maximum number of address families on this system (as macro) */
#define AF_MAX AF_NUMOF /**< alias for @ref AF_NUMOF */
};

#endif /* OPENWSN_AF_H */
Loading

0 comments on commit 654bdcf

Please sign in to comment.