Questions tagged [nesc]

nesC (pronounced "NES-see") is an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS.

nesC (pronounced "NES-see") is an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS. TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM).

The basic concepts behind nesC are:

  • Separation of construction and composition: programs are built out of components, which are assembled ("wired") to form whole programs. Components have internal concurrency in the form of tasks. Threads of control may pass into a component through its interfaces. These threads are rooted either in a task or a hardware interrupt.

  • Specification of component behaviour in terms of set of interfaces. Interfaces may be provided or used by components. The provided interfaces are intended to represent the functionality that the component provides to its user, the used interfaces represent the functionality the component needs to perform its job.

  • Interfaces are bidirectional: they specify a set of functions to be implemented by the interface's provider (commands) and a set to be implemented by the interface's user (events). This allows a single interface to represent a complex interaction between components (e.g., registration of interest in some event, followed by a callback when that event happens). This is critical because all lengthy commands in TinyOS (e.g. send packet) are non-blocking; their completion is signaled through an event (send done). By specifying interfaces, a component cannot call the send command unless it provides an implementation of the sendDone event.

  • Typically commands call downwards, i.e., from application components to those closer to the hardware, while events call upwards. Certain primitive events are bound to hardware interrupts.

  • Components are statically linked to each other via their interfaces. This increases runtime efficiency, encourages rubust design, and allows for better static analysis of programs.

  • nesC is designed under the expectation that code will be generated by whole-program compilers. This should also allow for better code generation and analysis.

Taken from: http://nescc.sourceforge.net/

73 questions
0
votes
1 answer

How to connect LED's in nesC?

I am trying to understand how nesC's modules, configurations, interfaces, and components work. To do this I have tried to implement a very simple application; when its done booting up, it should turn on its three LED's to show its ID. But I get the…
SørenHN
  • 566
  • 5
  • 20
0
votes
0 answers

Buggy output while running TestNetworkC.nc in TelosB i.e TinyOS

I am trying to analyze a network by measuring Throughput, Packet Delivery Ratio and Network Lifetime using TelosB. I am using TinyOS-2.1.1 for simulating and programming. As a base code, I am using the TestNetworkC.nc that comes with the OS. I have…
Irfanuddin
  • 2,295
  • 1
  • 15
  • 29
0
votes
0 answers

In nesC can command AMSend.send and event Receive.receive work at the same time?

Although i used interface PacketAcknowledgements,i still found i can't guarantee the communication between within one hop... In my experiment,i only use two motes,every 1 second each node send one packet to the other,then i discovered the command…
ybk1996
  • 1
  • 1
0
votes
0 answers

questions about PacketAcknowledgements in nesC,TinyOS

In order to learn how to use the interface PacketAcknowledgements,i try to modify the example in apps/RadioCountToLeds,but there are some problem,the transmit of data can't be done and it seems there is no ack back to the sender. the file…
ybk1996
  • 1
  • 1
0
votes
2 answers

field 'info' must be a network type

I'm a beginner and I try to create a struct in nesc for a tinyos app, but i have this error that i don't know how to fix. Any ideas? The code of the struct is: typedef nx_struct Message { nx_uint16_t ID float info; } messaget;
user3121051
  • 21
  • 1
  • 6
0
votes
0 answers

Sublime Text 3 cannot support nesC language Syntax Highlighting

Sublime Text 3 editor has been installed in Window10 OS, i get a package named nesC.tmbundle (from https://github.com/cdwilson/nesC.tmbundle) that can support nesC syntax highlighting in Mac and Linux platform, but it cannot make the nesC language…
Ryan
  • 33
  • 3
0
votes
1 answer

how to receive diffrent types of messages in NesC

I'm a bigginer in NesC langage and I want to learn how to reveive diffrent messages, in my case I have to send hello msg and other type of msg but at the reception I don't know how to specify the received msg if it is a hello ar other I did this for…
lyly
  • 1
  • 1
0
votes
1 answer

Transmition of an 1D array of more than 20 bytes to receiver node

I am using tinyOs (nesC) for communication between telosB motes. I am unable to send a 1D array of more that 20 bytes size to the receiver even if I initialize it using uint32_t. Can anyone help?
krahim1
  • 1
  • 1
0
votes
1 answer

I want my multihopOscilloscope to send data through radio and Serial port as well

I am trying to modify the multihop Oscilloscope program so that the sink node is able to send data both to UART and radio medium as well. As far as researched, I found out that the same hardware is used for sending packets via UART and radio too. In…
0
votes
1 answer

TinyOs nesc Packet acknowledge

I want to write a mote-mote radio communication program, and want the receiver acknowledges back to the sender. I know the PacketAcknowledgements is recommended, but there are some questions I'm not sure about this interface. 1. If I use it in the…
Fan
  • 189
  • 1
  • 3
  • 11
0
votes
1 answer

Pointer error when compiling nesc

I have the following method/event in nesc. I am getting an error event message_t* Receive.receive(message_t* bufPtr, void* payload, uint8_t len) { dbg("RadioCountToLedsC", "Received packet of length %hhu.\n", len); radio_count_msg_t* adammsg =…
chevybow
  • 9,959
  • 6
  • 24
  • 39
0
votes
1 answer

TinyOS Mote to PC Communication Error in HplAtm128UartC

Good Morning, I'm trying to use TinyOS for a WSN. I'm using the app folder where there are: - BaseStation - BaseStation 15.4 - test/TestSerial but for all app when i do "make iris" it generate the error: In component HplAtm128UartC': …
0
votes
1 answer

Tiny OS timer not resetting

I'am currently working on tinyos and I Am trying to reset timer lets say to 2 seconds when it is running at 45 seconds but it is not working, i can't figure out why, can someone help me figure it out here is the code: printf("timer before…
warl0ck
  • 3,356
  • 4
  • 27
  • 57
0
votes
1 answer

NesC (variant of C): implicit declaration of function startTimers()

I am compiling the following code (on a mote). And I have the following error: line 174: implicit declaration of function 'startTimers' Could you please help me? Here is my code. #include "Timer.h" #include "Oscilloscope.h" module Oscilloscope2C…
tom
  • 55
  • 1
  • 9
0
votes
1 answer

nesC (C-like) question

This is the code from TestAVBoardM.nc file in nesC language: #define BUFFERLEN 32768 uint32_t gBuffer[BUFFERLEN] __attribute__((aligned(32))); uint32_t gNumSamples = BUFFERLEN/4; event void Audio.ready(result_t success) { call…
user397232
  • 1,750
  • 6
  • 21
  • 30