Re: [riot-devel] Global IPV6

2016-07-13 Thread Thomas C. Schmidt

Hi Baptiste,

are you in search for a trigger that fires every time a new prefix is 
advertised/seen? Or do you refer to the event of a new IPv6 interface 
being configured?


Cheers,
 Thomas

On 13.07.2016 16:51, Baptiste Clenet wrote:

Hi,

How can I be informed that my node has got a new global IPV6? I would
like to call a function every time the node get a new global IPV6
address. How can I do that?

Cheers,



--

Prof. Dr. Thomas C. Schmidt
° Hamburg University of Applied Sciences   Berliner Tor 7 °
° Dept. Informatik, Internet Technologies Group20099 Hamburg, Germany °
° http://www.haw-hamburg.de/inet   Fon: +49-40-42875-8452 °
° http://www.informatik.haw-hamburg.de/~schmidtFax: +49-40-42875-8409 °
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Global IPV6

2016-07-13 Thread Baptiste Clenet
Thanks Martine!

2016-07-13 17:07 GMT+02:00 Martine Lenders :
> Hi,
> the the end of the `add` handler [1] for the IPv6 interfaces should be the
> best place for that.
>
> Cheers,
> Martine
>
> [1]
> https://github.com/RIOT-OS/RIOT/blob/master/sys/net/gnrc/network_layer/ipv6/netif/gnrc_ipv6_netif.c#L160
>
> 2016-07-13 17:04 GMT+02:00 Baptiste Clenet :
>>
>> Ok, it's what I thought. How can I temporary hack the source code to
>> get this event handler? Where should I add my function. I need it for
>> some tests
>>
>> 2016-07-13 16:55 GMT+02:00 Martine Lenders :
>> > Hi Baptiste,
>> > as of now no such event handler exist, but I note such feature it down
>> > for
>> > the network layer overhaul (previously known as neighbor discovery
>> > overhaul). Expect some early API proposals the week after IETF.
>> >
>> > Cheers,
>> > Martine
>> >
>> > 2016-07-13 16:51 GMT+02:00 Baptiste Clenet :
>> >>
>> >> Hi,
>> >>
>> >> How can I be informed that my node has got a new global IPV6? I would
>> >> like to call a function every time the node get a new global IPV6
>> >> address. How can I do that?
>> >>
>> >> Cheers,
>> >>
>> >> --
>> >> Baptiste
>> >> ___
>> >> devel mailing list
>> >> devel@riot-os.org
>> >> https://lists.riot-os.org/mailman/listinfo/devel
>> >
>> >
>> >
>> > ___
>> > devel mailing list
>> > devel@riot-os.org
>> > https://lists.riot-os.org/mailman/listinfo/devel
>> >
>>
>>
>>
>> --
>> Baptiste
>> ___
>> devel mailing list
>> devel@riot-os.org
>> https://lists.riot-os.org/mailman/listinfo/devel
>
>
>
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>



-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


[riot-devel] Global IPV6

2016-07-13 Thread Baptiste Clenet
Hi,

How can I be informed that my node has got a new global IPV6? I would
like to call a function every time the node get a new global IPV6
address. How can I do that?

Cheers,

-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Global IPV6

2016-07-13 Thread Martine Lenders
Hi Baptiste,
as of now no such event handler exist, but I note such feature it down for
the network layer overhaul (previously known as neighbor discovery
overhaul). Expect some early API proposals the week after IETF.

Cheers,
Martine

2016-07-13 16:51 GMT+02:00 Baptiste Clenet :

> Hi,
>
> How can I be informed that my node has got a new global IPV6? I would
> like to call a function every time the node get a new global IPV6
> address. How can I do that?
>
> Cheers,
>
> --
> Baptiste
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Stop other thread

2016-07-13 Thread Kaspar Schleiser
Hey,

On 07/13/2016 01:32 PM, Baptiste Clenet wrote:
> I've got a chip which needs precise timing to be read. A year ago, I
> was able to communicate with this chip but now, even if I go as fast I
> can it seems that timing have increased with same source code.
> So is there a way to force the CPU to do only one task at the time for
> the duration of the function. Can we tell the scheduler to stop other thread?

two things might interrupt:

1. a thread with higher priority

This can be solved by increasing the priority of the thread talking to
your code, possibly to the maximum.
(beware: lower priority value means higher priority)

2. interrupts

If an interrupt messes with your timing, that can be prevented by
disabling interrupts for a time-critical section:

unsigned state = irq_disable()
/* timing critical code */
irq_restore(state);

Kaspar


___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Stop other thread

2016-07-13 Thread Baptiste Clenet
Should I simply run a thread with highest priority so I'm sure it will
be run before running other thread?

2016-07-13 13:32 GMT+02:00 Baptiste Clenet :
> Hi,
>
> I've got a chip which needs precise timing to be read. A year ago, I
> was able to communicate with this chip but now, even if I go as fast I
> can it seems that timing have increased with same source code.
> So is there a way to force the CPU to do only one task at the time for
> the duration of the function. Can we tell the scheduler to stop other thread?
>
> Cheers,
>
> 2016-07-13 13:32 GMT+02:00 Baptiste Clenet :
>> Hi,
>>
>> I've got a chip which needs precise timing to be read. A year ago, I
>> was able to communicate with this chip but now, even if I go as fast I
>> can it seems that timing have increased with same source code.
>> So is there a way to force the CPU to do only one task at the time for
>> the duration of the function. Ca
>>
>> --
>> Baptiste
>
>
>
> --
> Baptiste



-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Stop other thread

2016-07-13 Thread Baptiste Clenet
Hi,

I've got a chip which needs precise timing to be read. A year ago, I
was able to communicate with this chip but now, even if I go as fast I
can it seems that timing have increased with same source code.
So is there a way to force the CPU to do only one task at the time for
the duration of the function. Can we tell the scheduler to stop other thread?

Cheers,

2016-07-13 13:32 GMT+02:00 Baptiste Clenet :
> Hi,
>
> I've got a chip which needs precise timing to be read. A year ago, I
> was able to communicate with this chip but now, even if I go as fast I
> can it seems that timing have increased with same source code.
> So is there a way to force the CPU to do only one task at the time for
> the duration of the function. Ca
>
> --
> Baptiste



-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


[riot-devel] Stop other thread

2016-07-13 Thread Baptiste Clenet
Hi,

I've got a chip which needs precise timing to be read. A year ago, I
was able to communicate with this chip but now, even if I go as fast I
can it seems that timing have increased with same source code.
So is there a way to force the CPU to do only one task at the time for
the duration of the function. Ca

-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] I have question about scheduler when all thread in sleep

2016-07-13 Thread Joakim Nohlgård
Dear Teemu,
What you are describing sounds like the xtimer subsystem in RIOT. It uses a
hardware timer to schedule tasks in the future.
See examples/xtimer_periodic_wakeup in the RIOT sources for an example on
how to achieve periodic scheduling for your task.

Also note that the function xtimer_usleep_until used in the example may be
renamed xtimer_periodic_wakeup in a near future, see [1].
The functionality will remain the same and the example will be updated at
the same time the rename happens.

[1]: https://github.com/RIOT-OS/RIOT/pull/5612

Best regards,
Joakim

On Wed, Jul 13, 2016 at 10:53 AM, Teemu Hakala  wrote:

>
>
> > On 12 Jul 2016, at 22:02, Kaspar Schleiser  wrote:
> >
> > The system gets woken up by external interrupts, e.g., a timer,
> > gpio-pin. That powers up the MCU
>
> > thread_flag), that triggers the scheduler and
>
> > The scheduler never wakes up itself
>
> In this thinking concept of achieving some repetitive task, you should
> perhaps configure a hw timer to create a stream of interrupts.
>
> Said interrupts then individually wake up mcu, go via irq handler and
> start processing that then yields, allowing the scheduler to put mcu into
> sleep mode. This is then repeated.
>
> Most normal modern mcus support configuring a timer for this purpose, the
> interrupts can come from an external source or mcu internal peripherals
> such as adc can act as interrupt stream generator.
>
>  - t
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] I have question about scheduler when all thread in sleep

2016-07-13 Thread Teemu Hakala


> On 12 Jul 2016, at 22:02, Kaspar Schleiser  wrote:
> 
> The system gets woken up by external interrupts, e.g., a timer,
> gpio-pin. That powers up the MCU 

> thread_flag), that triggers the scheduler and 

> The scheduler never wakes up itself

In this thinking concept of achieving some repetitive task, you should perhaps 
configure a hw timer to create a stream of interrupts.

Said interrupts then individually wake up mcu, go via irq handler and start 
processing that then yields, allowing the scheduler to put mcu into sleep mode. 
This is then repeated.

Most normal modern mcus support configuring a timer for this purpose, the 
interrupts can come from an external source or mcu internal peripherals such as 
adc can act as interrupt stream generator.

 - t
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel