Changeset 577
- Timestamp:
- 05/04/08 22:45:25 (2 weeks ago)
- Files:
-
- nano-RK/projects/SAMPL/client/generate.c (modified) (3 diffs)
- nano-RK/projects/SAMPL/client/p2p_handler.c (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/tests/neighbor-pkt/main.c (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/tests/stats-pkt/main.c (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/xmpp-client/ff_config.txt (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/xmpp-client/main.c (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/xmpp-client/sensor_cal.c (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/xmpp-client/sensor_cal.txt (modified) (1 diff)
- nano-RK/projects/SAMPL/slip-clients/xmpp-client/xmpp_pkt_writer.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nano-RK/projects/SAMPL/client/generate.c
r549 r577 57 57 } 58 58 59 // Don't reply if packet is not encrypted60 // if((ds_pkt->ctrl_flags & ENCRYPT) == 0 ) return;61 59 62 60 if(ds_pkt->is_mac_selected==1) … … 77 75 78 76 case CONTROL_PKT: 77 // Don't reply if packet is not encrypted 78 if((ds_pkt->ctrl_flags & ENCRYPT) == 0 ) return; 79 79 control_generate(us_pkt,ds_pkt); 80 80 break; … … 94 94 95 95 case ROUTE_PKT: 96 // Don't reply if packet is not encrypted 97 if((ds_pkt->ctrl_flags & ENCRYPT) == 0 ) return; 96 98 route_generate(us_pkt,ds_pkt); 97 99 break; nano-RK/projects/SAMPL/client/p2p_handler.c
r566 r577 103 103 nrk_kprintf (PSTR ("Wireless Update Packet\r\n")); 104 104 #endif 105 // Don't reply if packet is not encrypted 106 if((p2p_pkt_in->ctrl_flags & ENCRYPT) == 0 ) return; 105 107 phoenix_wireless_update(); 106 108 // This function reboots, it never returns... nano-RK/projects/SAMPL/slip-clients/tests/neighbor-pkt/main.c
r550 r577 94 94 ds_pkt.priority=0; 95 95 ds_pkt.ack_retry=10; 96 ds_pkt.subnet_mac[0]= 0;96 ds_pkt.subnet_mac[0]=1; 97 97 ds_pkt.subnet_mac[1]=0; 98 98 ds_pkt.subnet_mac[2]=0; nano-RK/projects/SAMPL/slip-clients/tests/stats-pkt/main.c
r575 r577 93 93 ds_pkt.priority=0; 94 94 ds_pkt.ack_retry=10; 95 ds_pkt.subnet_mac[0]= 0;95 ds_pkt.subnet_mac[0]=1; 96 96 ds_pkt.subnet_mac[1]=0; 97 97 ds_pkt.subnet_mac[2]=0; nano-RK/projects/SAMPL/slip-clients/xmpp-client/ff_config.txt
r575 r577 29 29 # 0x01 0x01 0xb9 0x07 0x00 0xf0 0x00 0x00 0x00 0x00 0x00 0x06 0x01 0x78 0x64 0xd3 0x00 0x00 0x00 0x00 0x00 30 30 # 0x01 0x01 0xb9 0x07 0x00 0xf0 0x00 0x00 0x00 0x00 0x00 0x06 0x01 0x78 0x64 0xd3 0x00 0x00 0x00 0x00 0x00 31 0x01 0x01 0x39 0x07 0x00 0xf0 0x00 0x00 0x0 0 0x00 0x00 0x06 0x01 0x10 0x32 0xd3 0x00 0x00 0x00 0x00 0x0031 0x01 0x01 0x39 0x07 0x00 0xf0 0x00 0x00 0x01 0x00 0x00 0x06 0x01 0xf0 0x32 0xd3 0x00 0x00 0x00 0x00 0x00 32 32 nano-RK/projects/SAMPL/slip-clients/xmpp-client/main.c
r575 r577 22 22 #define P2P_PACKET 2 23 23 24 #define gw_subnet_2 024 #define gw_subnet_2 1 25 25 #define gw_subnet_1 0 26 26 #define gw_subnet_0 0 nano-RK/projects/SAMPL/slip-clients/xmpp-client/sensor_cal.c
r575 r577 65 65 if(adc_in==0) adc_in=1; 66 66 if( voltage>3.3 ) voltage=3.3; 67 vo=((float)adc_in/ 255.0)*voltage;67 vo=((float)adc_in/1023.0)*voltage; 68 68 t=2196200.0+(((1.8639-vo)*100000)/(.388)); 69 //printf( "adc_in=%d voltage=%f vo=%f t=%f\n",adc_in, voltage, vo,t ); 69 70 t=-1481.96+sqrt(t); 70 71 return t; nano-RK/projects/SAMPL/slip-clients/xmpp-client/sensor_cal.txt
r575 r577 1 1 # MAC TEMP LIGHT 2 00000000 0.0 0 2 00000101 -5.0 0 3 00000102 -3.0 0 4 00000103 -1.0 0 5 00000104 -2.7 0 6 00000105 -3.0 0 7 00000106 -0.2 0 8 00000107 -1.6 0 9 00000108 -3.3 0 10 00000109 -3.3 0 11 0000010a -0.7 0 12 0000010b -4.6 0 13 0000010c -1.6 0 14 0000010d -1.6 0 15 0000010e -3.3 0 16 17 nano-RK/projects/SAMPL/slip-clients/xmpp-client/xmpp_pkt_writer.c
r575 r577 157 157 gw_pkt->subnet_mac[0], 158 158 p.mac_addr); 159 160 c_mac=gw_pkt->subnet_mac[2]<<24 | gw_pkt->subnet_mac[1]<<16 | gw_pkt->subnet_mac[0]<<8 | p.mac_addr; 161 printf( "temp offset=%f\n",cal_get_temp_offset(c_mac)); 159 162 160 161 c_mac=gw_pkt->subnet_mac[2]<<24 | gw_pkt->subnet_mac[1]<<16 | gw_pkt->subnet_mac[0]<<8 | p.mac_addr; 162 163 temp_cal=cal_get_temp(p.temperature,((float)(p.battery+100))/100)+cal_get_temp_offset(c_mac); 163 temp_cal=cal_get_temp((p.temperature<<1)+300,((float)(p.battery+100))/100)+cal_get_temp_offset(c_mac); 164 164 light_cal=cal_get_light(p.light, ((float)(p.battery+100))/100)+cal_get_light_offset(c_mac); 165 165 if(debug_txt_flag==1) printf( "Data for node: %s\n",node_name ); … … 174 174 { 175 175 case 1: 176 sprintf(buf,"<Node id=\"%s\" type=\"FIREFLY\" timestamp=\"%s\"> <Sensor name=\"Light\" value=\"%d\" /> <Sensor name=\"Temperature\" value=\"%2.2f\"/> <Sensor name=\"Acceleration\" value=\"%d\"/> <Sensor name=\"Voltage\" value=\"%1.2f\"/> <Sensor name=\"Audio\" value=\"%d\"/> </Node>",176 sprintf(buf,"<Node id=\"%s\" type=\"FIREFLY\" timestamp=\"%s\"> <Sensor name=\"Light\" value=\"%d\" id=\"0001\"/> <Sensor name=\"Temperature\" value=\"%2.2f\" id=\"0002\"/> <Sensor name=\"Acceleration\" value=\"%d\" id=\"0003\"/> <Sensor name=\"Voltage\" value=\"%1.2f\" id=\"0004\"/> <Sensor name=\"Audio\" value=\"%d\" id=\"0005\"/> </Node>", 177 177 node_name,timeStr, light_cal, temp_cal, p.acceleration, ((float)(p.battery+100))/100,p.sound_level); 178 178 break;
