Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • e-24/public/ahoi/firmware
1 result
Show changes
Showing
with 163 additions and 19 deletions
......@@ -109,9 +109,11 @@ aci_rxlevel_fillReply(uint8_t * payload)
* public functions
*/
void
bool
aci_rxlevel_processCmd(__attribute__ ((unused)) const mm_packet_t * pkt)
{
// read-only
return true;
}
......
......@@ -44,7 +44,7 @@
/**
* get power level value
*/
extern void
extern bool
aci_rxlevel_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
......@@ -68,12 +68,14 @@ aci_rxthresh_fillReply(uint8_t * payload)
* public functions
*/
void
bool
aci_rxthresh_processCmd(const mm_packet_t * pkt)
{
// optional action, always return current state
if (pkt->header.len == sizeof(aci_rxthresh_cmd_t)) {
freq_setRxThresholdPerc(((aci_rxthresh_cmd_t *)pkt->payload)->rxThresh);
}
return true;
}
......
......@@ -43,7 +43,7 @@
/**
* change rx threshold
*/
extern void
extern bool
aci_rxthresh_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
......@@ -110,14 +110,14 @@ clearTrigger(void)
* public functions
*/
void
bool
aci_sample_processCmd(const mm_packet_t * pkt)
{
aci_sample_cmd_t * cmd = (aci_sample_cmd_t *)pkt->payload;
// sanity checks
if (reqTrigger >= ACI_SAMPLE_TRIGGER_NUM) {
return;
return false;
}
// reset triggering
......@@ -138,6 +138,8 @@ aci_sample_processCmd(const mm_packet_t * pkt)
// set 'now'-trigger
aci_sample_trigger(ACI_SAMPLE_TRIGGER_NOW);
return true;
}
......
......@@ -124,7 +124,7 @@ aci_sample_check(void);
/**
* starts a new log
*/
extern void
extern bool
aci_sample_processCmd(const mm_packet_t * pkt);
......
......@@ -64,9 +64,11 @@ uint16_t SFD_STAT[SFD_SEQ_NUM_MAX];
* public functions
*/
void
bool
aci_sfdstat_processCmd(__attribute__ ((unused)) const mm_packet_t * pkt)
{
// read-only
return true;
}
......
......@@ -47,7 +47,7 @@
/**
* get packet statistics
*/
extern void
extern bool
aci_sfdstat_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
......@@ -61,10 +61,11 @@
* public functions
*/
void
bool
aci_sfdstat_reset_processCmd(__attribute__ ((unused)) const mm_packet_t * pkt)
{
aci_sfdstat_clear();
return true;
}
......
......@@ -44,7 +44,7 @@
/**
* get packet statistics
*/
extern void
extern bool
aci_sfdstat_reset_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
/**
* Copyright 2016-2020
*
* Bernd-Christian Renner, and
* Hamburg University of Technology (TUHH).
* All rights reserved.
*
* 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 of the copyright holder 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
* HOLDER 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 "aci.h"
#include "aci_sleep.h"
#include <hal_sleep.h>
/**************************************************************************
* private prototypes
*/
/**************************************************************************
* private functions
*/
/**************************************************************************
* public functions
*/
bool
aci_sleep_processCmd(__attribute__ ((unused)) const mm_packet_t * pkt)
{
return hal_requestSleep();
}
uint8_t
aci_sleep_fillReply(uint8_t * payload)
{
return 0;
}
/**
* Copyright 2016-2020
*
* Bernd-Christian Renner, and
* Hamburg University of Technology (TUHH).
* All rights reserved.
*
* 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 of the copyright holder 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
* HOLDER 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 ACI_SLEEP_H
#define ACI_SLEEP_H
#include "types.h"
/**
* get firmware version
*/
extern bool
aci_sleep_processCmd(const mm_packet_t * pkt);
/**
* send reply
*/
extern uint8_t
aci_sleep_fillReply(uint8_t * payload);
#endif /* ACI_SLEEP_H */
......@@ -85,9 +85,10 @@ aci_sniffmode_isEnabled(void) {
}
void
bool
aci_sniffmode_processCmd(const mm_packet_t * pkt)
{
// optional action, always return current state
if (pkt->header.len == sizeof(aci_sniffmode_cmd_t)) {
aci_sniffmode_cmd_t * a = (aci_sniffmode_cmd_t *)pkt->payload;
if (a->en) {
......@@ -96,6 +97,7 @@ aci_sniffmode_processCmd(const mm_packet_t * pkt)
sniffmode_disable();
}
}
return true;
}
......
......@@ -46,7 +46,7 @@
* TODO
*/
extern void
extern bool
aci_sniffmode_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
......@@ -72,13 +72,15 @@ aci_synclen_fillReply(uint8_t * payload)
* public functions
*/
void
bool
aci_synclen_processCmd(const mm_packet_t * pkt)
{
// optional action, always return current state
if (pkt->header.len == sizeof(aci_synclen_cmd_t)) {
freq_setNumSyncTxSymbols(((aci_synclen_cmd_t *)pkt->payload)->txNumSymbols);
freq_setNumSyncRxSymbols(((aci_synclen_cmd_t *)pkt->payload)->rxNumSymbols);
}
return true;
}
......
......@@ -43,7 +43,7 @@
/**
* gets/sets the preamble/sync length (in symbols)
*/
extern void
extern bool
aci_synclen_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
......@@ -67,9 +67,11 @@ uint16_t SYNC_STAT[SYNC_SYMBOLS_NUM_MAX];
* public functions
*/
void
bool
aci_syncstat_processCmd(__attribute__ ((unused)) const mm_packet_t * pkt)
{
// read-only
return true;
}
......
......@@ -46,7 +46,7 @@
/**
* get packet statistics
*/
extern void
extern bool
aci_syncstat_processCmd(const mm_packet_t * pkt);
extern uint8_t
......
......@@ -61,10 +61,11 @@
* public functions
*/
void
bool
aci_syncstat_reset_processCmd(__attribute__ ((unused)) const mm_packet_t * pkt)
{
aci_syncstat_clear();
return true;
}
......
......@@ -44,7 +44,7 @@
/**
* get packet statistics
*/
extern void
extern bool
aci_syncstat_reset_processCmd(const mm_packet_t * pkt);
extern uint8_t
......