BugID:23252728: Fix knx demo code styles and include path.
#include <stdio.h>
#include <aos/kernel.h>
-#include "uknx.h"
-#include "uknx_ll.h"
+#include "knx/uknx.h"
+#include "knx/uknx_ll.h"
#define EXPECT_EQ(a, b) do{ if(a!=b) return -1;} while(0)
@@ -33,9 +33,11 @@ static void data_proc(UKNX_DATA_EVENT * pd)
if( pd->type == DATA_EVENT_GROUP ) {
UKNX_BUF dpt = pd->data;
- } else if(pd->type == DATA_EVENT_PROP) {
+ } else
+ if( pd->type == DATA_EVENT_PROP ) {
- } else if(pd->type == DATA_EVENT_SYSTEM) {
+ } else
+ if( pd->type == DATA_EVENT_SYSTEM ) {
UKNX_BUF npdu = pd->data;
}
}
@@ -118,14 +120,17 @@ int application_start(int argc, char *argv[])
UKNX_LL_FRAME *pb = ( UKNX_LL_FRAME * )frame;
while( 1 ) {
- if(busytime)
+ if( busytime ) {
aos_msleep( busytime >> 10 );
- else
+ } else {
aos_msleep( 300 );
+ }
ret = uknx_proc();
//When engine busy time, no then A_XXX API call but uknx_proc
- if(busytime) continue;
+ if( busytime ) {
+ continue;
+ }
if( loop > 2 && !test && connected ) {
test = 1;
@@ -176,7 +181,9 @@ int application_start(int argc, char *argv[])
};
- if(connected) uknx_ll_stop();
+ if( connected ) {
+ uknx_ll_stop();
+ }
return 0;
}
