<s> import logging <EOL> import logging . handlers <EOL> import raspberrypi <EOL> from time import sleep <EOL> from GPS_I2C import GPS_NavigatronSensor <EOL> def test_buffer_conversion ( gps_sensor ) : <EOL> buffer_1 = [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] <EOL> lat_1 , lon_1 = gps_sensor . convert_buffer ( buffer_1 ) <EOL> print "<STR_LIT>" % ( buffer_1 , lat_1 , lon_1 ) <EOL> buffer_2 = [ <NUM_LIT> , <NUM_LIT:8> , <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] <EOL> lat_2 , lon_2 = gps_sensor . convert_buffer ( buffer_2 ) <EOL> print "<STR_LIT>" % ( buffer_2 , lat_2 , lon_2 ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> logger = logging . getLogger ( ) <EOL> logger . setLevel ( logging . DEBUG ) <EOL> logger . addHandler ( logging . StreamHandler ( ) ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> gps_sensor = GPS_NavigatronSensor ( interface = raspberrypi . i2c_bus ( ) , debug = True ) <EOL> print "<STR_LIT>" <EOL> ( fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp ) = gps_sensor . read_sensor ( ) <EOL> print fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp <EOL> sleep ( <NUM_LIT:5> ) <EOL> print "<STR_LIT>" <EOL> ( fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp ) = gps_sensor . read_sensor ( ) <EOL> print fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp <EOL> sleep ( <NUM_LIT:5> ) <EOL> print "<STR_LIT>" <EOL> ( fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp ) = gps_sensor . read_sensor ( ) <EOL> print fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp <EOL> sleep ( <NUM_LIT:5> ) <EOL> print "<STR_LIT>" <EOL> ( fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp ) = gps_sensor . read_sensor ( ) <EOL> print fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp <EOL> sleep ( <NUM_LIT:5> ) <EOL> print "<STR_LIT>" <EOL> ( fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp ) = gps_sensor . read_sensor ( ) <EOL> print fix , lat , lon , heading , speed , altitude , num_sat , timestamp , datestamp <EOL> sleep ( <NUM_LIT:5> ) <EOL> print "<STR_LIT>" </s>
