From ee3771eb07abf18215857755ba97926238daa6b7 Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 2 Apr 2007 16:18:15 +0000 Subject: [PATCH] Added analog value object to the ReadProperty handler for the pic18f6720 ports demo. --- bacnet-stack/ports/pic18f6720/h_rp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bacnet-stack/ports/pic18f6720/h_rp.c b/bacnet-stack/ports/pic18f6720/h_rp.c index a20f589a..012a525e 100644 --- a/bacnet-stack/ports/pic18f6720/h_rp.c +++ b/bacnet-stack/ports/pic18f6720/h_rp.c @@ -151,6 +151,24 @@ void handler_read_property(uint8_t * service_request, } } break; + case OBJECT_ANALOG_VALUE: + if (Analog_Value_Valid_Instance(data.object_instance)) { + len = Analog_Value_Encode_Property_APDU(&Temp_Buf[0], + data.object_instance, + data.object_property, + data.array_index, &error_class, &error_code); + if (len >= 0) { + /* encode the APDU portion of the packet */ + data.application_data = &Temp_Buf[0]; + data.application_data_len = len; + /* FIXME: probably need a length limitation sent with encode */ + len = + rp_ack_encode_apdu(&Handler_Transmit_Buffer + [pdu_len], service_data->invoke_id, &data); + error = false; + } + } + break; default: break; }