Comments (3)
Thanks for bringing this up!
As you said packed was removed for Cortex-M0 compatibility. And indeed this breaks the radio_ping
app, i was not yet aware of this. In applications using the D7AP stack on top of the PHY this is not a problem since the packet
struct which encapsulates the hw_radio_packet_t
defines an array of explicit size right after the flexible array member. This size is fixed for now, and the plan was to make this a cmake option, to allow optimizing the memory usage for application which don't need big packet sizes. It is never really dynamically allocated though.
I'm not sure the C spec even allows/specifies adding struct members which are not arrays with defined size after the flexible array member, like radio_ping
does. I propose to keep the struct non packed, state this more clearly in the hw_radio_packet_t
comments and fix radio_ping
(which can actually be removed coming to think of it). What do you think?
from sub-iot-stack.
Only after I lodged this issue I realised that it did not matter for the D7AP stack. I stumbled over this as I was testing a new radio against each of the apps, including radio_ping
.
I agree it is better to keep the struct unpacked, even if only for aligned access. A quick check of the C99 standard does not mention anything about using flexible array members in this way so it seems to be undefined behaviour. As for making packet sizes a CMake option, while nice to have, it's only an issue for memory-constrained systems and the current configuration is fine.
In this case to avoid further confusion, the radio_ping
app should be removed--the phy_test
app does pretty much the same thing anyway. Thanks for the clarification.
from sub-iot-stack.
Hi Simon,
Thanks for all the work and feedback. Really appreciate it!!!
Maarten
Sent from my Samsung Galaxy smartphone.
-------- Original message --------
From: Simon Haines [email protected]
Date: 26/05/2016 02:42 (GMT+01:00)
To: MOSAIC-LoPoW/dash7-ap-open-source-stack [email protected]
Subject: Re: [MOSAIC-LoPoW/dash7-ap-open-source-stack] SI4460 incorrectly assumes packed structs (#34)
Only after I lodged this issue I realised that it did not matter for the D7AP stack. I stumbled over this as I was testing a new radio against each of the apps, including radio_ping.
I agree it is better to keep the struct unpacked, even if only for aligned access. A quick check of the C99 standard does not mention anything about using flexible array members in this way so it seems to be undefined behaviour. As for making packet sizes a CMake option, while nice to have, it's only an issue for memory-constrained systems and the current configuration is fine.
In this case to avoid further confusion, the radio_ping app should be removed--the phy_test app does pretty much the same thing anyway. Thanks for the clarification.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/34#issuecomment-221747906
from sub-iot-stack.
Related Issues (20)
- noise_logger.c compile fails - userbutton.h not found HOT 2
- sniffer.c compile fails - alp_cmd_handler.h not found HOT 1
- I2C on B_L072Z_LRWAN1 platform HOT 2
- Sensor Action example: assertion "is_fs_init_completed" failed HOT 1
- Sensor Action example: incorrect value in RTT logs HOT 4
- STM32 hw_get_unique_id() bug HOT 4
- Gateway software ? HOT 1
- RTT Logging does not work well with Sleep
- Performance results available? HOT 1
- Bug scheduling messages in the unsollicited response callback HOT 8
- Board resets when sending message using default access class at index 1 set to normal rate. HOT 6
- Scheduler hangs when scheduling a task through interrupt service routine HOT 1
- Unkown hardfault when running C++ on B-L072Z-LRWAN1 HOT 2
- Enforce .clang-format
- Assertion fail in timer_fired() HOT 5
- Some compiler flags that cause errors now that might be worth it to be fixed HOT 2
- ALP_ITF_ID_D7ASP interface config format doesn't seem to match spec (same with pyd7a impl) HOT 2
- alp_received_unsolicited_data_cb does not get called anymore HOT 5
- ALP layer: unsolicited commands are sent back in the response HOT 1
- Compilation Error while running make HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sub-iot-stack.