[Bacnet-developers] Understanding AVR port
Brought to you by:
skarg
|
From: Isaac C. <son...@ya...> - 2008-01-20 00:56:30
|
Hi to all,
Forgive me for creating a new e-mail but I tried to follow-up from my previous e-mail dated (01/13/2008) but don't know how to follow-up or reply to my e-mail, I can only send e-mail to bac...@li....
After more readings on the Internet and different bacnet hardware ports for (i.e. PIC, AT91SAM, rtos32, etc.) I see sometimes comments like photocell input but after reading all the relevant files that I never really see a conversion for the photocell or any analog input. So what I am understanding is that bacnet stack 0.4.2 is just that a stack and for some services who is, i am that does not require an actual hardware i/o it's fine to response. However, when there is an actual hardware i/o (i.e. analog or digital i/o) that the implementor (me I think) will do the actual coding. So I start building the hardware part Linux with rs-232 to rs-485 converter and a couple of AVR 168 with rs-485 and I'm planning to use the MSTP protocol. My pseudocode for the AVR 168 port to simulate a relay (replace with an led for now) is:
main() {
init hardware // enable the uart interrupt routine
init bacnet stack // enable the output binary for the led (simulating a relay)
for (;;) // loop forever
// some housekeping codes
;
}
// my uart interrupt handler
decode message
if service is write binary output property then send it to the binary output handler
// my binary output handler
if write binary output property then active the led on/off based on the received message
send ack to master
If what I'm thinking is correct the actual activation of the hardware is done in the handler service that the implementor added (binary output in the case above).
Does this make sense?
Thanks for any help.
Sonny
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping |