Comments (3)
I don't think this is the right solution to the problem. I accept there are
cases where a platform-specific implementation of HdlcUart is valuable. As
I understand the basis for this change, it's because tos/lib/ppp is not in
the .platform @includes list for any platform, so the use of PFLAGS +=
-I$(TOSDIR)/tos/lib/ppp to provide access to it causes that implementation
to supersede any platform-specific implementation. By moving it to
tos/lib/serial, which is in all .platform @include lists, it can be
overridden in a platform-specific way.
On reviewing all this, I've come to a couple conclusions:
* Though I named PlatformSerialHdlcUartC that way because it was an
implementation of HdlcUartC that was based on PlatformSerialC, it was not
intended to itself be a Platform*C component. If moved to tos/lib/serial
as proposed, it would be the first example of a so-named component that
had both shared and platform-optimized implementations. In fact, it
should be renamed to something like DefaultHdlcUartC.
* All the component does is implement HdlcUart, an interface that is not
being proposed for use anywhere except in tos/lib/ppp, where its main
value is in feeding into HdlcFraming, which is still pretty specific to
PPP. I don't think a component in tos/lib/serial (available on all
platforms) should have a dependency on an interface in tos/lib/ppp (must
be explicitly enabled).
* PlatformSerialHdlcUartC is not used in any components that are not
applications, so explicitly selecting an alternative is not hidden.
I propose the following alternative solution:
* I will commit a patch that renames the component and all its uses to
DefaultHdlcUart[CP]. (I want to do this because it's not quite that
simple: there are unit tests that must also be modified which, by the way,
fail because they specifically test that implementation, and thus fail in
the branch that uses the telosa variant.)
* You (sdhags) commit your updated PlatformHdlcUartC [sic] component inside
the telosa directory, then use code like:
#if PLATFORM_TELOSA /* or other platforms providing this */
components PlatformHdlcUartC;
PppDaemonC.HdlcUart -> PlatformSerialHdlcUartC;
PppDaemonC.UartControl -> PlatformSerialHdlcUartC;
#else
components DefaultHdlcUartC;
PppDaemonC.HdlcUart -> DefaultHdlcUartC;
PppDaemonC.UartControl -> DefaultHdlcUartC;
#endif
in PppRouter and any other application which needs the sped-up version.
What do you think, sirs?
Original comment by [email protected]
on 13 Jun 2011 at 12:46
- Changed state: Started
from tinyos-main.
I think you are right since we aren't and don't want to propose a new
platform-wide abstraction for this purpose. Since we can't do this system-wide
(by the implementor of UartStream) without breaking the semantics of that
interface, this seems reasonable and consistent what has been done in other
places. I did notice that the test cases break because they pull in
SerialPrintfC and thus the other uart stack; what I did was just remove the
printf dependency but clearly this can't actually get checked in; it would be
nice if I could run the tests using the DMA driver to check that it works the
same way, though.
I'll keep an eye out for those changes and make the changes you suggest once
they show up.
Original comment by [email protected]
on 13 Jun 2011 at 7:04
from tinyos-main.
Rename completed in r5645 on trunk.
Original comment by [email protected]
on 18 Jun 2011 at 8:43
- Changed state: Fixed
from tinyos-main.
Related Issues (20)
- [patch] UdpP scribbles to memory it should not. HOT 3
- [patch] IPPacketC uses error return value as offset, resulting in trashed memory HOT 3
- "Make safe" does not work with the CC2420 radio chip HOT 2
- Msp430Adc12ClientAutoRVGC does not release resource. HOT 2
- PowerCycleP__startRadio task in permanent re-post spin HOT 2
- Memory Leaks : When check out some unknow critical option Libcoap allocate memory but never free HOT 3
- TOSSIM PYTHON_VERSION on Ubuntu 11.04 x86_64 HOT 3
- Shimmer I2C with msp430-gcc v4.5.3 HOT 3
- Shimmer PowerSupplyMonitor with msp430-gcc v4.5.3 HOT 2
- msp430 code accessed with bit fields HOT 1
- tos-bsl broken for shimmer family HOT 6
- [patch] CoapUdpServer infinite loop HOT 4
- [patch] CoapUdpServer fails to include the client token in many cases HOT 3
- telosb CC2420X compile error with LPL app HOT 1
- [patch] Incorrect 6lowpan PAN handling HOT 4
- rfxlink TrafficMonitorLayerP time variable shadows global one when compiling with TOSSIM HOT 3
- [patch] RF212 frame receive doesn't always complete SPI transfer HOT 2
- [patch] Dhcp6Client fails to find Status options HOT 2
- [patch] Dhcp6Client issues IPAddress.setAddress() even on RENEW HOT 1
- [patch] Dhcp6Client waits unnecessarily long between ADVERTISE and REQUEST
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 tinyos-main.