Changeset 577

Show
Ignore:
Timestamp:
05/04/08 22:45:25 (2 weeks ago)
Author:
agr
Message:

SAMPL night before roberts deployment commit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nano-RK/projects/SAMPL/client/generate.c

    r549 r577  
    5757        } 
    5858 
    59 // Don't reply if packet is not encrypted 
    60 // if((ds_pkt->ctrl_flags & ENCRYPT) == 0 ) return; 
    6159 
    6260if(ds_pkt->is_mac_selected==1) 
     
    7775 
    7876  case CONTROL_PKT: 
     77        // Don't reply if packet is not encrypted 
     78        if((ds_pkt->ctrl_flags & ENCRYPT) == 0 ) return; 
    7979        control_generate(us_pkt,ds_pkt); 
    8080        break; 
     
    9494 
    9595  case ROUTE_PKT: 
     96        // Don't reply if packet is not encrypted 
     97        if((ds_pkt->ctrl_flags & ENCRYPT) == 0 ) return; 
    9698        route_generate(us_pkt,ds_pkt); 
    9799        break; 
  • nano-RK/projects/SAMPL/client/p2p_handler.c

    r566 r577  
    103103    nrk_kprintf (PSTR ("Wireless Update Packet\r\n")); 
    104104#endif 
     105    // Don't reply if packet is not encrypted 
     106    if((p2p_pkt_in->ctrl_flags & ENCRYPT) == 0 ) return; 
    105107    phoenix_wireless_update(); 
    106108    // This function reboots, it never returns... 
  • nano-RK/projects/SAMPL/slip-clients/tests/neighbor-pkt/main.c

    r550 r577  
    9494        ds_pkt.priority=0; 
    9595        ds_pkt.ack_retry=10; 
    96         ds_pkt.subnet_mac[0]=0
     96        ds_pkt.subnet_mac[0]=1
    9797        ds_pkt.subnet_mac[1]=0; 
    9898        ds_pkt.subnet_mac[2]=0; 
  • nano-RK/projects/SAMPL/slip-clients/tests/stats-pkt/main.c

    r575 r577  
    9393        ds_pkt.priority=0; 
    9494        ds_pkt.ack_retry=10; 
    95         ds_pkt.subnet_mac[0]=0
     95        ds_pkt.subnet_mac[0]=1
    9696        ds_pkt.subnet_mac[1]=0; 
    9797        ds_pkt.subnet_mac[2]=0; 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/ff_config.txt

    r575 r577  
    2929# 0x01 0x01 0xb9 0x07 0x00 0xf0 0x00 0x00 0x00 0x00 0x00 0x06 0x01 0x78 0x64 0xd3 0x00 0x00 0x00 0x00 0x00 
    3030# 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 0x00 0x00 0x00 0x06 0x01 0x10 0x32 0xd3 0x00 0x00 0x00 0x00 0x00 
     310x01 0x01 0x39 0x07 0x00 0xf0 0x00 0x00 0x01 0x00 0x00 0x06 0x01 0xf0 0x32 0xd3 0x00 0x00 0x00 0x00 0x00 
    3232 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/main.c

    r575 r577  
    2222#define P2P_PACKET      2 
    2323 
    24 #define gw_subnet_2     0 
     24#define gw_subnet_2     1 
    2525#define gw_subnet_1     0 
    2626#define gw_subnet_0     0 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/sensor_cal.c

    r575 r577  
    6565if(adc_in==0) adc_in=1; 
    6666if( voltage>3.3 ) voltage=3.3; 
    67 vo=((float)adc_in/255.0)*voltage; 
     67vo=((float)adc_in/1023.0)*voltage; 
    6868t=2196200.0+(((1.8639-vo)*100000)/(.388)); 
     69//printf( "adc_in=%d voltage=%f vo=%f t=%f\n",adc_in, voltage, vo,t ); 
    6970t=-1481.96+sqrt(t); 
    7071return t; 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/sensor_cal.txt

    r575 r577  
    11# MAC           TEMP    LIGHT 
    2 00000000        0.0     0 
     200000101        -5.0    0 
     300000102        -3.0    0 
     400000103        -1.0    0 
     500000104        -2.7    0 
     600000105        -3.0    0 
     700000106        -0.2    0 
     800000107        -1.6    0 
     900000108        -3.3    0 
     1000000109        -3.3    0 
     110000010a        -0.7    0 
     120000010b        -4.6    0 
     130000010c        -1.6    0 
     140000010d        -1.6    0 
     150000010e        -3.3    0 
     16 
     17 
  • nano-RK/projects/SAMPL/slip-clients/xmpp-client/xmpp_pkt_writer.c

    r575 r577  
    157157                gw_pkt->subnet_mac[0], 
    158158                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)); 
    159162 
    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); 
    164164        light_cal=cal_get_light(p.light, ((float)(p.battery+100))/100)+cal_get_light_offset(c_mac); 
    165165        if(debug_txt_flag==1) printf( "Data for node: %s\n",node_name ); 
     
    174174        { 
    175175         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>", 
    177177                node_name,timeStr, light_cal, temp_cal, p.acceleration, ((float)(p.battery+100))/100,p.sound_level); 
    178178                break;