...
 
Commits (8)
......@@ -48,7 +48,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <hn70ap/system.h>
#include <hn70ap/eeprom.h>
#include <hn70ap/radio.h>
/****************************************************************************
* Public Functions
......@@ -72,10 +74,8 @@ int main(int argc, FAR char *argv[])
int beacon_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
char *data;
int ret = OK;
int fd;
int buflen = 1024;
uint32_t seqnum = 0;
char call[9];
......@@ -83,22 +83,20 @@ int beacon_main(int argc, char *argv[])
uint8_t *buf;
if(argc == 3)
{
devname = argv[1];
data = argv[2];
}
else if(argc == 2)
if(argc == 2)
{
data = argv[1];
}
else if(argc == 1)
else
{
data = "HELLO 73";
}
else
ret = hn70ap_system_init();
if(ret != 0)
{
return beacon_usage();
fprintf(stderr, "hn70ap init failed!\n");
return ERROR;
}
buf = malloc(buflen);
......@@ -110,15 +108,7 @@ int beacon_main(int argc, char *argv[])
}
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto retfree;
}
printf("\nTX beacon using %s\n", devname);
printf("\nTX beacon using aux radio\n");
/* Define payload */
hn70ap_eeconfig_getcall("call", call);
......@@ -129,14 +119,14 @@ int beacon_main(int argc, char *argv[])
{
fprintf(stderr, "call sign not defined, see config app\n");
ret = ERROR;
goto retclose;
goto retfree;
}
while(1)
{
sprintf(buf, "DE %s/%d HN70AP TEST BEACON SEQ %u: %s\n", call, ssid, seqnum, data);
printf("%s", buf);
ret = write(fd, buf, strlen(buf));
sprintf((char*)buf, "DE %s/%d HN70AP TEST BEACON SEQ %u: %s\n", call, ssid, seqnum, data);
printf("%s", (char*)buf);
ret = hn70ap_radio_transmit(HN70AP_RADIO_AUX, buf, strlen((char*)buf));
if(ret < 0)
{
printf("write failed, errno=%d\n", errno);
......@@ -146,8 +136,6 @@ int beacon_main(int argc, char *argv[])
seqnum += 1;
}
retclose:
close(fd);
retfree:
free(buf);
done:
......
/****************************************************************************
* hn70ap/apps/export/lcd.h
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef HN70AP_LCD_H
#define HN70AP_LCD_H
int hn70ap_lcd_init(void);
int hn70ap_lcd_drawchar(int row, int col, char *ch);
int hn70ap_lcd_drawstr(int row, int col, char *ch);
#endif
......@@ -33,10 +33,21 @@
*
****************************************************************************/
#ifndef HN70AP_TIMER
#define HN70AP_TIMER
#ifndef HN70AP_LEDS
#define HN70AP_LEDS
int leds_init(void);
int leds_state(int led, int state);
#define LED_STATE_OFF 0
#define LED_STATE_ON 1
#define LED_1A 0
#define LED_1B 1
#define LED_RED 2
#define LED_ORANGE 3
#define LED_GREEN 4
#define LED_HEARTBEAT 5
#define LED_MACLINK 6
int hn70ap_leds_init(void);
int hn70ap_leds_state(int led, int state);
#endif //HN70AP_TIMER
/****************************************************************************
* hn70ap/apps/export/radio.h
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef HN70AP_RADIO_H
#define HN70AP_RADIO_H
#include <stdint.h>
#include <stdbool.h>
#define HN70AP_RADIO_MAIN 1
#define HN70AP_RADIO_AUX 2
int hn70ap_radio_init(void);
int hn70ap_radio_transmit(uint8_t device, uint8_t *buf, size_t len);
int hn70ap_radio_receive (uint8_t device, uint8_t *buf, size_t len);
#endif /* HN70AP_SYSTEM_H */
/****************************************************************************
* hn70ap/apps/export/system.h
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef HN70AP_SYSTEM_H
#define HN70AP_SYSTEM_H
#include <stdint.h>
#include <stdbool.h>
int hn70ap_system_init(void);
#endif /* HN70AP_SYSTEM_H */
......@@ -36,6 +36,6 @@
#ifndef HN70AP_TIMER
#define HN70AP_TIMER
int timer_init(void);
int hn70ap_timer_init(void);
#endif //HN70AP_TIMER
......@@ -36,7 +36,7 @@
-include $(TOPDIR)/Make.defs
ASRCS =
CSRCS = eeprom.c leds.c timer.c
CSRCS = eeprom.c leds.c lcd.c timer.c system.c radio.c
CSRCS += tlv.c crc.c sha256.c hdlc.c
CSRCS += update.c
......
This diff is collapsed.
......@@ -46,18 +46,21 @@
#include <nuttx/leds/userled.h>
#include <hn70ap/timer.h>
#include <hn70ap/leds.h>
int leds_init(void)
int hn70ap_leds_init(void)
{
/* TODO open driver once and for all to speed up led update? */
return 0;
}
int leds_state(int lednum, bool state)
int hn70ap_leds_state(int lednum, int state)
{
struct userled_s led;
int fd;
int ret;
fd = open("/dev/userleds", O_RDWR);
fd = open("/dev/leds", O_WRONLY);
if(fd<0)
{
fprintf(stderr, "Failed to open LEDS device\n");
......@@ -65,12 +68,13 @@ int leds_state(int lednum, bool state)
}
led.ul_led = lednum;
led.ul_on = state;
led.ul_on = (state == LED_STATE_ON);
ret = ioctl(fd, ULEDIOC_SETLED, (unsigned long)&led);
if(ret<0)
{
fprintf(stderr, "Failed to change LED state\n");
close(fd);
return -1;
}
......
/****************************************************************************
* hn70ap/apps/libhn70ap/radio.c
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <fcntl.h>
#include <syslog.h>
#include <unistd.h>
#include <pthread.h>
#include <hn70ap/radio.h>
#include <hn70ap/leds.h>
static int g_hn70ap_fdmainradio;
static int g_hn70ap_fdauxradio;
static bool g_hn70ap_radioalive;
static pthread_t g_hn70ap_txthreadid;
/****************************************************************************
* hn70ap_radio_txthread
* This thread waits for radio transmit requests from other processes,
* and sends packets.
****************************************************************************/
void *hn70ap_radio_txthread(void *arg)
{
syslog(LOG_INFO, "Started radio RX thread\n");
while(g_hn70ap_radioalive)
{
//Wait for messages in transmit queue
//Transmit these messages
}
syslog(LOG_INFO, "Stopped radio RX thread\n");
}
/****************************************************************************
* hn70ap_radio_transmit
****************************************************************************/
int hn70ap_radio_transmit(uint8_t device, uint8_t *buf, size_t len)
{
int fd;
int ret;
if(device == HN70AP_RADIO_MAIN)
{
fd = g_hn70ap_fdmainradio;
}
else if(device == HN70AP_RADIO_AUX)
{
fd = g_hn70ap_fdauxradio;
}
else
{
return ERROR;
}
/* Turn on radio LED in transmit mode */
hn70ap_leds_state(LED_1A, LED_STATE_ON);
hn70ap_leds_state(LED_1B, LED_STATE_OFF);
/* Transmit */
ret = write(fd, buf, len);
/* Turn off radio LED */
hn70ap_leds_state(LED_1A, LED_STATE_OFF);
hn70ap_leds_state(LED_1B, LED_STATE_OFF);
return ret;
}
/****************************************************************************
* hn70ap_radio_receive
****************************************************************************/
int hn70ap_radio_receive(uint8_t device, uint8_t *buf, size_t len)
{
int fd;
int ret;
if(device == HN70AP_RADIO_MAIN)
{
fd = g_hn70ap_fdmainradio;
}
else if(device == HN70AP_RADIO_AUX)
{
fd = g_hn70ap_fdauxradio;
}
else
{
return ERROR;
}
/* Turn on radio LED in transmit mode */
hn70ap_leds_state(LED_1A, LED_STATE_OFF);
hn70ap_leds_state(LED_1B, LED_STATE_ON);
/* Transmit */
ret = read(fd, buf, len);
/* Turn off radio LED */
hn70ap_leds_state(LED_1A, LED_STATE_OFF);
hn70ap_leds_state(LED_1B, LED_STATE_OFF);
return ret;
}
/****************************************************************************
* hn70ap_radio_init
****************************************************************************/
int hn70ap_radio_init(void)
{
int ret = 0;
#ifdef CONFIG_HN70AP_MAINRADIO
syslog(LOG_INFO, "Checking main radio\n");
g_hn70ap_fdmainradio = open("/dev/rmain", O_RDWR);
if(g_hn70ap_fdmainradio<0)
{
syslog(LOG_ERR, "Failed to access main radio!\n");
ret = -1;
goto lret;
}
#endif
#ifdef CONFIG_HN70AP_AUXRADIO
syslog(LOG_INFO, "Checking aux radio\n");
g_hn70ap_fdauxradio = open("/dev/raux", O_RDWR);
if(g_hn70ap_fdauxradio<0)
{
syslog(LOG_ERR, "Failed to access aux radio!\n");
ret = -1;
goto lret;
}
#endif
g_hn70ap_radioalive = true;
ret = pthread_create(&g_hn70ap_txthreadid, NULL, hn70ap_radio_txthread, NULL);
if(ret < 0)
{
syslog(LOG_ERR, "Failed to start the transmit thread\n");
}
lret:
return ret;
}
/****************************************************************************
* hn70ap/apps/libhn70ap/system.c
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <syslog.h>
#include <hn70ap/eeprom.h>
#include <hn70ap/timer.h>
#include <hn70ap/leds.h>
#include <hn70ap/radio.h>
static bool hn70ap_system_initialized = false;
int hn70ap_system_init(void)
{
int ret;
bool defaults;
if(hn70ap_system_initialized)
{
syslog(LOG_WARNING, "System already initialized\n");
return 0;
}
/* Initialize timer thread to help us schedule delays */
ret = hn70ap_timer_init();
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize timers\n");
return ERROR;
}
/* Initialize the leds */
/* Requires timer for blinking */
ret = hn70ap_leds_init();
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize Leds\n");
return ERROR;
}
/* Initialize the EEPROM */
ret = hn70ap_eeconfig_init(&defaults);
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize EEPROM\n");
return ERROR;
}
if(defaults)
{
syslog(LOG_ERR, "WARNING: Default config values loaded in EEPROM\n");
}
ret = hn70ap_radio_init();
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize Radios\n");
return ERROR;
}
hn70ap_system_initialized = true;
return OK;
}
......@@ -36,11 +36,78 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#include <syslog.h>
#include <semaphore.h>
#include <time.h>
#include <hn70ap/timer.h>
#include <hn70ap/leds.h>
struct timer_s
{
struct timer_s *next; /* List link */
int id; /* Timer identifier, for deletion */
struct timespec expiration; /* Expiration date, checked in timer thread */
uint32_t repeat_delay; /* If zero, one shoot, else, reload delay */
void *arg; /* Callback argument */
void (*callback)(void *arg); /* Timer callback */
};
struct timer_s *g_timers_head;
struct timer_s *g_timers_tail;
static pthread_t g_timerthreadid;
static int heartbeat;
static void *timer_thread(void *arg)
{
sem_t sem;
struct timespec tout;
sem_init(&sem, 0, 0);
syslog(LOG_INFO, "Starting timer thread\n");
clock_gettime(CLOCK_REALTIME, &tout);
while(true)
{
tout.tv_nsec += 100000000;
if(tout.tv_nsec > 1000000000)
{
tout.tv_nsec -= 1000000000;
tout.tv_sec += 1;
}
sem_timedwait(&sem, &tout);
/* Toggle the heartbeat LED */
hn70ap_leds_state(LED_HEARTBEAT, (heartbeat<9)?LED_STATE_OFF:LED_STATE_ON);
heartbeat += 1;
if(heartbeat == 10) heartbeat = 0;
/* Look at the next timer */
}
return NULL;
}
int hn70ap_timer_init(void)
{
int ret;
g_timers_head = NULL;
g_timers_tail = NULL;
heartbeat = 0;
ret = pthread_create(&g_timerthreadid, NULL, timer_thread, NULL);
return ret;
}
int timer_init(void)
int hn70ap_timer_add(void (*callback)(void*arg), void *arg, uint32_t delay, bool repeat)
{
return 0;
return -1;
}
......@@ -48,6 +48,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <hn70ap/system.h>
#include <hn70ap/radio.h>
/****************************************************************************
* Public Functions
****************************************************************************/
......@@ -62,7 +65,6 @@ int main(int argc, FAR char *argv[])
int rxt_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
int ret = OK;
int fd;
int buflen = 1024;
......@@ -70,40 +72,39 @@ int rxt_main(int argc, char *argv[])
uint8_t *buf;
if(argc > 1)
{
devname = argv[1];
}
printf("RX test using %s\n", devname);
printf("RX test using aux radio\n");
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto done;
}
hn70ap_system_init();
buf = malloc(buflen);
if(!buf)
{
fprintf(stderr, "open failed!\n");
fprintf(stderr, "malloc failed!\n");
ret = ERROR;
goto retclose;
goto done;
}
do
{
ret = read(fd, buf, buflen);
printf("read done, ret = %d, errno=%d\n", ret, errno);
ret = hn70ap_radio_receive(HN70AP_RADIO_AUX, buf, buflen);
//printf("read done, ret = %d, errno=%d\n", ret, errno);
if(ret > 0)
{
for(i=0; i<ret; i++)
/* for(i=0; i<ret; i++)
{
printf("%02X ", buf[i]);
}
printf("\n");
printf("\n");*/
for(i=0; i<ret; i++)
{
printf("%c", (buf[i]<0x20 && buf[i]!=0x0a)?'.':buf[i]);
}
}
else if(ret < 0 && errno==ETIMEDOUT)
{
printf("RX timeout\n");
// ret = 1;
// continue;
}
}
while(ret > 0);
......@@ -111,8 +112,6 @@ int rxt_main(int argc, char *argv[])
printf("Read sequence done.\n");
free(buf);
retclose:
close(fd);
done:
return ret;
}
......
......@@ -44,12 +44,14 @@
#include <sys/mount.h>
#include <hn70ap/eeprom.h>
#include <hn70ap/timer.h>
#include <hn70ap/system.h>
#include <hn70ap/leds.h>
#include <hn70ap/eeprom.h>
#include "sysdaemon_internal.h"
int nsh_main(int argc, char **argv);
/****************************************************************************
* Public Functions
****************************************************************************/
......@@ -62,7 +64,8 @@ void hn70ap_mount_storage(void)
ret = mount("/dev/smart0p1", "/data", "smartfs", 0, NULL);
if (ret < 0)
{
fprintf(stderr, "Storage could not be mounted\n");
fprintf(stderr, "WARNING Storage could not be mounted.\n"
"Try running mksmartfs /dev/smart0p1\n");
}
else
{
......@@ -82,69 +85,43 @@ int sysdaemon_main(int argc, char *argv[])
#endif
{
int ret;
bool defaults;
char call[9];
printf("\nhn70ap system daemon starting\n");
/* Initialize timer thread to help us schedule delays */
ret = timer_init();
if(ret != 0)
{
printf("FATAL: Failed to initialize timers\n");
goto lfail;
}
/* Initialize the leds */
/* Requires timer for blinking */
ret = hn70ap_system_init();
hn70ap_mount_storage();
hn70ap_netmonitor_init();
ret = leds_init();
if(ret != 0)
hn70ap_leds_state(LED_GREEN, LED_STATE_ON);
if(ret != OK)
{
printf("FATAL: Failed to initialize Leds\n");
goto lfail;
hn70ap_leds_state(LED_RED, LED_STATE_ON);
}
/* Initialize the EEPROM */
hn70ap_eeconfig_init(&defaults);
if(defaults)
hn70ap_eeconfig_getcall("call", call);
if(call[0] == 0)
{
printf("WARNING: Default config values loaded in EEPROM\n");
printf("Callsign not defined yet, please use the config tool\n");
}
else
{
hn70ap_eeconfig_getcall("call", call);
if(call[0] == 0)
{
printf("Callsign not defined yet, please use the config tool\n");
}
else
{
call[8] = 0;
printf("Hello %s, best 73's\n", call);
}
call[8] = 0;
printf("Hello %s, best 73's\n", call);
}
hn70ap_mount_storage();
hn70ap_netmonitor_init();
printf("TODO start screen management\n");
/* Try to open radio devices. */
#if defined(CONFIG_EXAMPLES_NSH)
printf("*** Launching nsh\n");
nsh_main(argc, argv);
#endif
printf("Back from nsh, now sleeping forever.\n");
hn70ap_leds_state(LED_GREEN, LED_STATE_OFF);
hn70ap_leds_state(LED_RED , LED_STATE_ON);
return 0;
lfail:
/* Panic... something could not be initialized
* Try to switch on the red LED
*/
return ERROR;
}
......@@ -56,8 +56,10 @@
#include <nuttx/net/ioctl.h>
#include <nuttx/leds/userled.h>
#include "netutils/netlib.h"
#include "netutils/dhcpc.h"
#include <netutils/netlib.h>
#include <netutils/dhcpc.h>
#include <hn70ap/leds.h>
#define NET_DEVNAME "eth0"
#define NETMONITOR_RETRYMSEC 1000
......@@ -90,7 +92,7 @@ static void dhcp_negociate(void)
if(ret != 0)
{
syslog(LOG_INFO, "DHCP request failed\n");
syslog(LOG_INFO, "DHCP request failed: %d errno %d\n", ret, errno);
goto close;
}
......@@ -141,18 +143,10 @@ close:
/*----------------------------------------------------------------------------*/
static void netmonitor_ifup(void* arg)
{
int fd;
struct userled_s led;
syslog(LOG_INFO, "Interface is going UP\n");
/* Enable the link LED */
led.ul_led = 6;
led.ul_on = true;
fd = open("/dev/leds", O_WRONLY);
ioctl(fd, ULEDIOC_SETLED, (unsigned long)&led);
close(fd);
hn70ap_leds_state(LED_MACLINK, LED_STATE_ON);
dhcp_negociate();
}
......@@ -160,18 +154,10 @@ static void netmonitor_ifup(void* arg)
/*----------------------------------------------------------------------------*/
static void netmonitor_ifdown(void)
{
int fd;
struct userled_s led;
syslog(LOG_INFO, "Interface is going DOWN\n");
/* Disable the link LED */
led.ul_led = 6;
led.ul_on = false;
fd = open("/dev/leds", O_WRONLY);
ioctl(fd, ULEDIOC_SETLED, (unsigned long)&led);
close(fd);
hn70ap_leds_state(LED_MACLINK, LED_STATE_OFF);
}
/*----------------------------------------------------------------------------*/
......@@ -459,6 +445,7 @@ int hn70ap_netmonitor_init(void)
ret = netlib_setmacaddr(NET_DEVNAME, mac);
if(ret)
{
syslog(LOG_ERR, "Set MAC on ethernet interface FAILED\n");
return ret;
}
......
......@@ -48,6 +48,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <hn70ap/system.h>
#include <hn70ap/radio.h>
/****************************************************************************
* Public Functions
****************************************************************************/
......@@ -55,7 +58,7 @@
int txt_usage(void)
{
printf(
"txt [device] hexdata_nospaces\n"
"txt hexdata_nospaces\n"
);
return ERROR;
}
......@@ -114,21 +117,14 @@ int main(int argc, FAR char *argv[])
int txt_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
char *data;
int ret = OK;
int fd;
int buflen = 1024;
int len;
uint8_t *buf;
if(argc == 3)
{
devname = argv[1];
data = argv[2];
}
else if(argc == 2)
if(argc == 2)
{
data = argv[1];
}
......@@ -137,6 +133,8 @@ int txt_main(int argc, char *argv[])
return txt_usage();
}
hn70ap_system_init();
buf = malloc(buflen);
if(!buf)
{
......@@ -159,20 +157,10 @@ int txt_main(int argc, char *argv[])
len += 1;
}
printf("\nTX test using %s (%d bytes)\n", devname, len);
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto retfree;
}
ret = write(fd, buf, len);
printf("\nTX test using aux radio(%d bytes)\n", len);
ret = hn70ap_radio_transmit(HN70AP_RADIO_AUX, buf, len);
printf("write done, ret = %d, errno=%d\n", ret, errno);
close(fd);
retfree:
free(buf);
done:
......
......@@ -131,6 +131,7 @@ CONFIG_ARCH="arm"
# CONFIG_ARCH_CHIP_LPC43XX is not set
# CONFIG_ARCH_CHIP_LPC54XX is not set
# CONFIG_ARCH_CHIP_MOXART is not set
# CONFIG_ARCH_CHIP_NRF52 is not set
# CONFIG_ARCH_CHIP_NUC1XX is not set
# CONFIG_ARCH_CHIP_SAMA5 is not set
# CONFIG_ARCH_CHIP_SAMD is not set
......@@ -474,7 +475,7 @@ CONFIG_STM32_DMA2=y
# CONFIG_STM32_DAC1 is not set
# CONFIG_STM32_DAC2 is not set
# CONFIG_STM32_DCMI is not set
# CONFIG_STM32_ETHMAC is not set
CONFIG_STM32_ETHMAC=y
# CONFIG_STM32_FSMC is not set
# CONFIG_STM32_HASH is not set
# CONFIG_HRTIM is not set
......@@ -602,6 +603,27 @@ CONFIG_STM32_I2CTIMEOTICKS=500
# CONFIG_STM32_HAVE_RTC_COUNTER is not set
# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set
#
# Ethernet MAC configuration
#
CONFIG_STM32_PHYADDR=0
CONFIG_STM32_PHYINIT=y
# CONFIG_STM32_MII is not set
CONFIG_STM32_AUTONEG=y
CONFIG_STM32_PHYSR=30
CONFIG_STM32_PHYSR_ALTCONFIG=y
CONFIG_STM32_PHYSR_ALTMODE=0x0007
CONFIG_STM32_PHYSR_10HD=0x0001
CONFIG_STM32_PHYSR_100HD=0x0002
CONFIG_STM32_PHYSR_10FD=0x0005
CONFIG_STM32_PHYSR_100FD=0x0006
# CONFIG_STM32_ETH_PTP is not set
CONFIG_STM32_RMII=y
# CONFIG_STM32_RMII_MCO1 is not set
# CONFIG_STM32_RMII_MCO2 is not set
CONFIG_STM32_RMII_EXTCLK=y
CONFIG_STM32_ETHMAC_HPWORK=y
#
# USB FS Host Configuration
#
......@@ -716,7 +738,8 @@ CONFIG_ARCH_LEDS=y
CONFIG_HN70AP_EEPROM=y
CONFIG_HN70AP_SPIFLASH=y
CONFIG_HN70AP_SCREEN=y
# CONFIG_HN70AP_ETHERNET is not set
CONFIG_HN70AP_ETHERNET=y
CONFIG_HN70AP_ETHERNET_EEMAC=y
CONFIG_HN70AP_RADIO=y
# CONFIG_HN70AP_MAINRADIO is not set
CONFIG_HN70AP_AUXRADIO=y
......@@ -1054,6 +1077,36 @@ CONFIG_NETDEVICES=y
# CONFIG_ENCX24J600 is not set
# CONFIG_NET_SLIP is not set
# CONFIG_NET_FTMAC100 is not set
#
# External Ethernet PHY Device Support
#
CONFIG_ARCH_PHY_INTERRUPT=y
# CONFIG_ETH0_PHY_NONE is not set
# CONFIG_ETH0_PHY_AM79C874 is not set
# CONFIG_ETH0_PHY_KS8721 is not set
# CONFIG_ETH0_PHY_KSZ8041 is not set
# CONFIG_ETH0_PHY_KSZ8051 is not set
# CONFIG_ETH0_PHY_KSZ8061 is not set
CONFIG_ETH0_PHY_KSZ8081=y
# CONFIG_ETH0_PHY_KSZ90x1 is not set
# CONFIG_ETH0_PHY_DP83848C is not set
# CONFIG_ETH0_PHY_LAN8720 is not set
# CONFIG_ETH0_PHY_LAN8740 is not set
# CONFIG_ETH0_PHY_LAN8740A is not set
# CONFIG_ETH0_PHY_LAN8742A is not set
# CONFIG_ETH0_PHY_DM9161 is not set
CONFIG_ETH1_PHY_NONE=y
# CONFIG_ETH1_PHY_AM79C874 is not set
# CONFIG_ETH1_PHY_KS8721 is not set
# CONFIG_ETH1_PHY_KSZ8041 is not set
# CONFIG_ETH1_PHY_KSZ8051 is not set
# CONFIG_ETH1_PHY_KSZ8081 is not set
# CONFIG_ETH1_PHY_KSZ90x1 is not set
# CONFIG_ETH1_PHY_DP83848C is not set
# CONFIG_ETH1_PHY_LAN8720 is not set
# CONFIG_ETH1_PHY_DM9161 is not set
# CONFIG_NETDEV_PHY_DEBUG is not set
# CONFIG_PIPES is not set
# CONFIG_PM is not set
# CONFIG_DRIVERS_POWERLED is not set
......@@ -1138,6 +1191,7 @@ CONFIG_DRIVERS_WIRELESS=y
CONFIG_DRIVERS_GENERICRADIO=y
CONFIG_GENERICRADIO_UPPER=y
CONFIG_GENERICRADIO_SI4463=y
CONFIG_GENERICRADIO_SI4463_ANTSWITCH_ALT=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L1 is not set
CONFIG_GENERICRADIO_SI4463_FRAMING_L2B=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L2L is not set
......@@ -1165,7 +1219,7 @@ CONFIG_SYSLOG_CONSOLE=y
# Networking Support
#
CONFIG_ARCH_HAVE_NET=y
# CONFIG_ARCH_HAVE_PHY is not set
CONFIG_ARCH_HAVE_PHY=y
# CONFIG_NET_WRITE_BUFFERS is not set
CONFIG_NET_READAHEAD=y
CONFIG_NET=y
......@@ -1207,7 +1261,7 @@ CONFIG_NET_IPv4=y
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCPPROTO_OPTIONS=y
# CONFIG_NET_TCPPROTO_OPTIONS is not set
# CONFIG_NET_SOLINGER is not set
#
......@@ -1225,7 +1279,7 @@ CONFIG_NET_TCPPROTO_OPTIONS=y
#
CONFIG_NET_TCP=y
# CONFIG_NET_TCP_NO_STACK is not set
CONFIG_NET_TCP_KEEPALIVE=y
# CONFIG_NET_TCP_KEEPALIVE is not set
# CONFIG_NET_TCPURGDATA is not set
# CONFIG_NET_TCP_REASSEMBLY is not set
CONFIG_NET_TCP_CONNS=8
......@@ -1319,6 +1373,7 @@ CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
# CONFIG_NFS is not set
# CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set
# CONFIG_FS_CROMFS is not set
# CONFIG_FS_TMPFS is not set
CONFIG_FS_SMARTFS=y
CONFIG_SMARTFS_ERASEDSTATE=0xff
......@@ -1565,6 +1620,7 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_SERIALBLASTER is not set
# CONFIG_EXAMPLES_SERIALRX is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SI5351 is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
# CONFIG_EXAMPLES_SMART_TEST is not set
......
......@@ -131,6 +131,7 @@ CONFIG_ARCH="arm"
# CONFIG_ARCH_CHIP_LPC43XX is not set
# CONFIG_ARCH_CHIP_LPC54XX is not set
# CONFIG_ARCH_CHIP_MOXART is not set
# CONFIG_ARCH_CHIP_NRF52 is not set
# CONFIG_ARCH_CHIP_NUC1XX is not set
# CONFIG_ARCH_CHIP_SAMA5 is not set
# CONFIG_ARCH_CHIP_SAMD is not set
......@@ -329,11 +330,11 @@ CONFIG_ARMV7M_HAVE_STACKCHECK=y
# CONFIG_ARCH_CHIP_STM32F407ZG is not set
# CONFIG_ARCH_CHIP_STM32F407IE is not set
# CONFIG_ARCH_CHIP_STM32F407IG is not set
# CONFIG_ARCH_CHIP_STM32F427V is not set
CONFIG_ARCH_CHIP_STM32F427V=y
# CONFIG_ARCH_CHIP_STM32F427Z is not set
# CONFIG_ARCH_CHIP_STM32F427I is not set
# CONFIG_ARCH_CHIP_STM32F429V is not set
CONFIG_ARCH_CHIP_STM32F429Z=y
# CONFIG_ARCH_CHIP_STM32F429Z is not set
# CONFIG_ARCH_CHIP_STM32F429I is not set
# CONFIG_ARCH_CHIP_STM32F429B is not set
# CONFIG_ARCH_CHIP_STM32F429N is not set
......@@ -382,8 +383,8 @@ CONFIG_STM32_STM32F4XXX=y
# CONFIG_STM32_STM32F411 is not set
# CONFIG_STM32_STM32F405 is not set
# CONFIG_STM32_STM32F407 is not set
# CONFIG_STM32_STM32F427 is not set
CONFIG_STM32_STM32F429=y
CONFIG_STM32_STM32F427=y
# CONFIG_STM32_STM32F429 is not set
# CONFIG_STM32_STM32F446 is not set
# CONFIG_STM32_STM32F469 is not set
# CONFIG_STM32_DFU is not set
......@@ -396,7 +397,7 @@ CONFIG_STM32_HAVE_CCM=y
CONFIG_STM32_HAVE_OTGFS=y
CONFIG_STM32_HAVE_FSMC=y
# CONFIG_STM32_HAVE_HRTIM1 is not set
CONFIG_STM32_HAVE_LTDC=y
# CONFIG_STM32_HAVE_LTDC is not set
CONFIG_STM32_HAVE_USART3=y
CONFIG_STM32_HAVE_UART4=y
CONFIG_STM32_HAVE_UART5=y
......@@ -481,8 +482,6 @@ CONFIG_STM32_ETHMAC=y
# CONFIG_STM32_I2C1 is not set
# CONFIG_STM32_I2C2 is not set
CONFIG_STM32_I2C3=y
# CONFIG_STM32_LTDC is not set
# CONFIG_STM32_DMA2D is not set
# CONFIG_STM32_OPAMP is not set
# CONFIG_STM32_OTGFS is not set
# CONFIG_STM32_OTGHS is not set
......@@ -740,13 +739,15 @@ CONFIG_HN70AP_SCREEN=y
CONFIG_HN70AP_ETHERNET=y
CONFIG_HN70AP_ETHERNET_EEMAC=y
CONFIG_HN70AP_RADIO=y
# CONFIG_HN70AP_MAINRADIO is not set
CONFIG_HN70AP_MAINRADIO=y
CONFIG_HN70AP_MAINRADIO_TCXO=y
CONFIG_HN70AP_AUXRADIO=y
# CONFIG_HN70AP_AUXRADIO_HIGHPOWER is not set
# CONFIG_BOARD_CRASHDUMP is not set
CONFIG_LIB_BOARDCTL=y
CONFIG_BOARDCTL_RESET=y
# CONFIG_BOARDCTL_UNIQUEID is not set
# CONFIG_BOARDCTL_APP_SYMTAB is not set
# CONFIG_BOARDCTL_IOCTL is not set
#
......@@ -1063,7 +1064,7 @@ CONFIG_NETDEVICES=y
#
# CONFIG_NETDEV_LOOPBACK is not set
# CONFIG_NETDEV_TELNET is not set
# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set
CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y
# CONFIG_NETDEV_LATEINIT is not set
# CONFIG_NET_DUMPPACKET is not set
......@@ -1109,6 +1110,7 @@ CONFIG_ETH1_PHY_NONE=y
# CONFIG_PM is not set
# CONFIG_DRIVERS_POWERLED is not set
# CONFIG_DRIVERS_SMPS is not set
# CONFIG_DRIVERS_MOTOR is not set
# CONFIG_POWER is not set
# CONFIG_SENSORS is not set
CONFIG_SERIAL=y
......@@ -1116,28 +1118,6 @@ CONFIG_SERIAL=y
# CONFIG_SERIAL_REMOVABLE is not set
CONFIG_SERIAL_CONSOLE=y
# CONFIG_16550_UART is not set
# CONFIG_UART_SERIALDRIVER is not set
# CONFIG_UART0_SERIALDRIVER is not set
# CONFIG_UART1_SERIALDRIVER is not set
# CONFIG_UART2_SERIALDRIVER is not set
# CONFIG_UART3_SERIALDRIVER is not set
CONFIG_UART4_SERIALDRIVER=y
# CONFIG_UART5_SERIALDRIVER is not set
# CONFIG_UART6_SERIALDRIVER is not set
# CONFIG_UART7_SERIALDRIVER is not set
# CONFIG_UART8_SERIALDRIVER is not set
# CONFIG_SCI0_SERIALDRIVER is not set
# CONFIG_SCI1_SERIALDRIVER is not set
# CONFIG_USART0_SERIALDRIVER is not set
# CONFIG_USART1_SERIALDRIVER is not set
# CONFIG_USART2_SERIALDRIVER is not set
# CONFIG_USART3_SERIALDRIVER is not set
# CONFIG_USART4_SERIALDRIVER is not set
# CONFIG_USART5_SERIALDRIVER is not set
# CONFIG_USART6_SERIALDRIVER is not set
# CONFIG_USART7_SERIALDRIVER is not set
# CONFIG_USART8_SERIALDRIVER is not set
# CONFIG_USART9_SERIALDRIVER is not set
# CONFIG_OTHER_UART_SERIALDRIVER is not set
CONFIG_MCU_SERIAL=y
CONFIG_STANDARD_SERIAL=y
......@@ -1151,6 +1131,16 @@ CONFIG_SERIAL_TERMIOS=y
CONFIG_UART4_SERIAL_CONSOLE=y
# CONFIG_OTHER_SERIAL_CONSOLE is not set
# CONFIG_NO_SERIAL_CONSOLE is not set
# CONFIG_UART_SERIALDRIVER is not set
# CONFIG_UART0_SERIALDRIVER is not set
# CONFIG_UART1_SERIALDRIVER is not set
# CONFIG_UART2_SERIALDRIVER is not set
# CONFIG_UART3_SERIALDRIVER is not set
CONFIG_UART4_SERIALDRIVER=y
# CONFIG_UART5_SERIALDRIVER is not set
# CONFIG_UART6_SERIALDRIVER is not set
# CONFIG_UART7_SERIALDRIVER is not set
# CONFIG_UART8_SERIALDRIVER is not set
#
# UART4 Configuration
......@@ -1164,6 +1154,28 @@ CONFIG_UART4_2STOP=0
# CONFIG_UART4_IFLOWCONTROL is not set
# CONFIG_UART4_OFLOWCONTROL is not set
# CONFIG_UART4_DMA is not set
# CONFIG_LPUART_SERIALDRIVER is not set
# CONFIG_LPUART0_SERIALDRIVER is not set
# CONFIG_LPUART1_SERIALDRIVER is not set
# CONFIG_LPUART2_SERIALDRIVER is not set
# CONFIG_LPUART3_SERIALDRIVER is not set
# CONFIG_LPUART4_SERIALDRIVER is not set
# CONFIG_LPUART5_SERIALDRIVER is not set
# CONFIG_LPUART6_SERIALDRIVER is not set
# CONFIG_LPUART7_SERIALDRIVER is not set
# CONFIG_LPUART8_SERIALDRIVER is not set
# CONFIG_USART0_SERIALDRIVER is not set
# CONFIG_USART1_SERIALDRIVER is not set
# CONFIG_USART2_SERIALDRIVER is not set
# CONFIG_USART3_SERIALDRIVER is not set
# CONFIG_USART4_SERIALDRIVER is not set
# CONFIG_USART5_SERIALDRIVER is not set
# CONFIG_USART6_SERIALDRIVER is not set
# CONFIG_USART7_SERIALDRIVER is not set
# CONFIG_USART8_SERIALDRIVER is not set
# CONFIG_USART9_SERIALDRIVER is not set
# CONFIG_SCI0_SERIALDRIVER is not set
# CONFIG_SCI1_SERIALDRIVER is not set
# CONFIG_PSEUDOTERM is not set
# CONFIG_USBDEV is not set
# CONFIG_USBHOST is not set
......@@ -1171,7 +1183,6 @@ CONFIG_UART4_2STOP=0
# CONFIG_HAVE_USBTRACE is not set
CONFIG_DRIVERS_WIRELESS=y
# CONFIG_WL_CC1101 is not set
# CONFIG_WL_CC3000 is not set
# CONFIG_WL_SPIRIT is not set
# CONFIG_SPIRIT_NETDEV is not set
# CONFIG_DRIVERS_IEEE802154 is not set
......@@ -1179,9 +1190,14 @@ CONFIG_DRIVERS_WIRELESS=y
CONFIG_DRIVERS_GENERICRADIO=y
CONFIG_GENERICRADIO_UPPER=y
CONFIG_GENERICRADIO_SI4463=y
CONFIG_GENERICRADIO_SI4463_ANTSWITCH_ALT=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L1 is not set
CONFIG_GENERICRADIO_SI4463_FRAMING_L2B=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L2L is not set
CONFIG_GENERICRADIO_SI4463_USE_WDS_CONFIG=y
# CONFIG_WL_NRF24L01 is not set
# CONFIG_DRIVERS_CONTACTLESS is not set
# CONFIG_1WIRE is not set
#
# System Logging
......@@ -1222,7 +1238,11 @@ CONFIG_NET_GUARDSIZE=2
# CONFIG_NET_USER_DEVFMT is not set
CONFIG_NET_ETHERNET=y
# CONFIG_NET_LOOPBACK is not set
# CONFIG_NET_TUN is not set
CONFIG_NET_TUN=y
CONFIG_TUN_NINTERFACES=1
CONFIG_NET_TUN_MTU=296
CONFIG_NET_TUN_TCP_RECVWNDO=256
CONFIG_TUN_HPWORK=y
# CONFIG_NET_USRSOCK is not set
#
......@@ -1245,7 +1265,7 @@ CONFIG_NET_IPv4=y
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCPPROTO_OPTIONS=y
# CONFIG_NET_TCPPROTO_OPTIONS is not set
# CONFIG_NET_SOLINGER is not set
#
......@@ -1263,7 +1283,7 @@ CONFIG_NET_TCPPROTO_OPTIONS=y
#
CONFIG_NET_TCP=y
# CONFIG_NET_TCP_NO_STACK is not set
CONFIG_NET_TCP_KEEPALIVE=y
# CONFIG_NET_TCP_KEEPALIVE is not set
# CONFIG_NET_TCPURGDATA is not set
# CONFIG_NET_TCP_REASSEMBLY is not set
CONFIG_NET_TCP_CONNS=8
......@@ -1287,6 +1307,10 @@ CONFIG_NET_BROADCAST=y
# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_NET_UDP_WRITE_BUFFERS is not set
#
# Bluetooth socket support
#
#
# IEEE 802.15.4 socket support
#
......@@ -1357,6 +1381,7 @@ CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
# CONFIG_NFS is not set
# CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set
# CONFIG_FS_CROMFS is not set
# CONFIG_FS_TMPFS is not set
CONFIG_FS_SMARTFS=y
CONFIG_SMARTFS_ERASEDSTATE=0xff
......@@ -1498,6 +1523,7 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
# CONFIG_LIBC_MODLIB is not set
# CONFIG_LIBC_WCHAR is not set
# CONFIG_LIBC_LOCALE is not set
# CONFIG_LIBC_LZF is not set
#
# Time/Time Zone Support
......@@ -1576,6 +1602,7 @@ CONFIG_EXAMPLES_FB_STACKSIZE=2048
# CONFIG_EXAMPLES_HIDKBD is not set
# CONFIG_EXAMPLES_IGMP is not set
# CONFIG_EXAMPLES_INA219 is not set
# CONFIG_EXAMPLES_IPFORWARD is not set
# CONFIG_EXAMPLES_JSON is not set
# CONFIG_EXAMPLES_LVGLDEMO is not set
# CONFIG_EXAMPLES_MEDIA is not set
......@@ -1602,7 +1629,6 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_SERIALBLASTER is not set
# CONFIG_EXAMPLES_SERIALRX is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SI5351 is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
# CONFIG_EXAMPLES_SMART_TEST is not set
......@@ -1656,6 +1682,9 @@ CONFIG_FSUTILS_MKSMARTFS=y
#
# hn70ap apps
#
CONFIG_HN70AP_BEACON=y
CONFIG_HN70AP_BEACON_PRIORITY=100
CONFIG_HN70AP_BEACON_STACKSIZE=2048
CONFIG_HN70AP_CONFIG=y
CONFIG_HN70AP_CONFIG_PRIORITY=100
CONFIG_HN70AP_CONFIG_STACKSIZE=2048
......
......@@ -147,7 +147,7 @@ int hn70ap_genradio_initialize(void)
/* Strobe the SDN pin to reset both devices */
stm32_configgpio(GPIO_RADIO_SDN);
stm32_gpiowrite(GPIO_RADIO_SDN, 1);
up_mdelay(1);
up_mdelay(10);
stm32_gpiowrite(GPIO_RADIO_SDN, 0);
/* Initialize radio devices */
......@@ -155,10 +155,14 @@ int hn70ap_genradio_initialize(void)
#if defined(CONFIG_HN70AP_MAINRADIO)
_info("Prepare main radio\n");
si4463_priv_main.gpio_irq = GPIO_IRQ_RADIOMAIN;
radio = si4463_init(spi4, 0, 30000000, SI4463_IO1, SI4463_IO3, &si4463_lower_main);
#if defined(CONFIG_HN70AP_MAINRADIO_TCXO)
radio = si4463_init(spi4, 0, 25000000, SI4463_IO1, SI4463_IO3, false, true, &si4463_lower_main);
#else
radio = si4463_init(spi4, 0, 30000000, SI4463_IO1, SI4463_IO3, false, false, &si4463_lower_main);
#endif
if(radio==NULL)
{
_err("Unable to initialize si4463\n");
_err("Unable to initialize main si4463\n");
}
else
{
......@@ -178,7 +182,7 @@ int hn70ap_genradio_initialize(void)
radio = RFM26_init(spi4, 1, SI4463_IO0, SI4463_IO1, &si4463_lower_aux);
if(radio==NULL)
{
_err("Unable to initialize si4463\n");
_err("Unable to initialize aux RFM26\n");
}
else
{
......