pub fn json_set_geolocation(&mut self, key: &Strn, lat_key: &Strn, long_key: &Strn, geo: SensorValueType) {
        if let SensorValueType::Geolocation { latitude, longitude, .. } = geo {
            let notused = self.to_void_ptr();
            let encoder = unsafe { &mut sensor_coap::coap_json_encoder };

            //  Encode the parent key.
            let key_cstr = self.key_strn_to_cstr(key);
            let rc = unsafe { json::json_encode_object_key(encoder, key_cstr as *mut u8) }; 
            assert!(rc == 0);

            //  Start the object.
            let rc = unsafe { json::json_encode_object_start(encoder) }; 
            assert!(rc == 0);

            //  Encode the latitude and longitude.
            let key_cstr = self.key_strn_to_cstr(lat_key);
            unsafe { mynewt_rust::json_helper_set_float(notused, key_cstr, latitude as f32) };
            let key_cstr = self.key_strn_to_cstr(long_key);
            unsafe { mynewt_rust::json_helper_set_float(notused, key_cstr, longitude as f32) };

            //  Close the object.
            let rc = unsafe { json::json_encode_object_finish(encoder) }; 
            assert!(rc == 0);
        };
    }
//  If floating-point is enabled...
If floating-point is enabled
If floating - point is enabled
pub fn json_set_geolocation(&mut self, key: &Strn, lat_key: &Strn, long_key: &Strn, geo: SensorValueType) {
        if let SensorValueType::Geolocation { latitude, longitude, .. } = geo {
            let notused = self.to_void_ptr();
            let encoder = unsafe { &mut sensor_coap::coap_json_encoder };
            //  Encode the parent key.
            let key_cstr = self.key_strn_to_cstr(key);
            let rc = unsafe { json::json_encode_object_key(encoder, key_cstr as *mut u8) }; 
            assert!(rc == 0);
            //  Start the object.
            let rc = unsafe { json::json_encode_object_start(encoder) }; 
            assert!(rc == 0);
            //  Encode the latitude and longitude.
            let key_cstr = self.key_strn_to_cstr(lat_key);
            unsafe { mynewt_rust::json_helper_set_float(notused, key_cstr, latitude as f32) };
            let key_cstr = self.key_strn_to_cstr(long_key);
            unsafe { mynewt_rust::json_helper_set_float(notused, key_cstr, longitude as f32) };
            //  Close the object.
            let rc = unsafe { json::json_encode_object_finish(encoder) }; 
            assert!(rc == 0);
        };
    }
pub fn json_set_geolocation ( & mut self , key : & Strn , lat_key : & Strn , long_key : & Strn , geo : SensorValueType ) { if let SensorValueType :: Geolocation { latitude , longitude , .. } = geo { let notused = self . to_void_ptr ( ) ; let encoder = unsafe { & mut sensor_coap :: coap_json_encoder } ; //  Encode the parent key. let key_cstr = self . key_strn_to_cstr ( key ) ; let rc = unsafe { json :: json_encode_object_key ( encoder , key_cstr as * mut u8 ) } ; assert ! ( rc 0 ) ; //  Start the object. let rc = unsafe { json :: json_encode_object_start ( encoder ) } ; assert ! ( rc 0 ) ; //  Encode the latitude and longitude. let key_cstr = self . key_strn_to_cstr ( lat_key ) ; unsafe { mynewt_rust :: json_helper_set_float ( notused , key_cstr , latitude as f32 ) } ; let key_cstr = self . key_strn_to_cstr ( long_key ) ; unsafe { mynewt_rust :: json_helper_set_float ( notused , key_cstr , longitude as f32 ) } ; //  Close the object. let rc = unsafe { json :: json_encode_object_finish ( encoder ) } ; assert ! ( rc 0 ) ; } ; }
If floating-point is enabled...
If floating - point is enabled ...
&mut self
key
&Strn
lat_key
&Strn
long_key
&Strn
geo
SensorValueType
&mut self
key
&Strn
lat_key
&Strn
long_key
&Strn
geo
SensorValueType