Added type hints to gnss

This commit is contained in:
dherrada 2020-07-03 10:26:31 -04:00
parent d73348f673
commit 6a3968d805
3 changed files with 15 additions and 15 deletions

View File

@ -90,7 +90,7 @@ STATIC mp_obj_t gnss_make_new(const mp_obj_type_t *type, size_t n_args, const mp
return MP_OBJ_FROM_PTR(self); return MP_OBJ_FROM_PTR(self);
} }
//| def deinit(self) -> Any: //| def deinit(self) -> None:
//| """Turn off the GNSS.""" //| """Turn off the GNSS."""
//| ... //| ...
//| //|
@ -107,7 +107,7 @@ STATIC void check_for_deinit(gnss_obj_t *self) {
} }
} }
//| def update(self) -> Any: //| def update(self) -> None:
//| """Update GNSS positioning information.""" //| """Update GNSS positioning information."""
//| ... //| ...
//| //|
@ -120,7 +120,7 @@ STATIC mp_obj_t gnss_obj_update(mp_obj_t self_in) {
} }
MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update); MP_DEFINE_CONST_FUN_OBJ_1(gnss_update_obj, gnss_obj_update);
//| latitude: Any = ... //| latitude: float = ...
//| """Latitude of current position in degrees (float).""" //| """Latitude of current position in degrees (float)."""
//| //|
STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) {
@ -137,7 +137,7 @@ const mp_obj_property_t gnss_latitude_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| longitude: Any = ... //| longitude: float = ...
//| """Longitude of current position in degrees (float).""" //| """Longitude of current position in degrees (float)."""
//| //|
STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) {
@ -154,7 +154,7 @@ const mp_obj_property_t gnss_longitude_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| altitude: Any = ... //| altitude: float = ...
//| """Altitude of current position in meters (float).""" //| """Altitude of current position in meters (float)."""
//| //|
STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) {
@ -171,7 +171,7 @@ const mp_obj_property_t gnss_altitude_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| timestamp: Any = ... //| timestamp: string = ...
//| """Time when the position data was updated.""" //| """Time when the position data was updated."""
//| //|
STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) {
@ -190,7 +190,7 @@ const mp_obj_property_t gnss_timestamp_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| fix: Any = ... //| fix: string = ...
//| """Fix mode.""" //| """Fix mode."""
//| //|
STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) {

View File

@ -32,17 +32,17 @@
//| def __init__(self): //| def __init__(self):
//| """Enum-like class to define the position fix mode.""" //| """Enum-like class to define the position fix mode."""
//| //|
//| INVALID: Any = ... //| INVALID: gnss.PositionFix = ...
//| """No measurement. //| """No measurement.
//| //|
//| :type gnss.PositionFix:""" //| :type gnss.PositionFix:"""
//| //|
//| FIX_2D: Any = ... //| FIX_2D: gnss.PositionFix = ...
//| """2D fix. //| """2D fix.
//| //|
//| :type gnss.PositionFix:""" //| :type gnss.PositionFix:"""
//| //|
//| FIX_3D: Any = ... //| FIX_3D: gnss.PositionFix = ...
//| """3D fix. //| """3D fix.
//| //|
//| :type gnss.PositionFix:""" //| :type gnss.PositionFix:"""

View File

@ -32,27 +32,27 @@
//| def __init__(self): //| def __init__(self):
//| """Enum-like class to define the satellite system type.""" //| """Enum-like class to define the satellite system type."""
//| //|
//| GPS: Any = ... //| GPS: gnss.SatelliteSystem = ...
//| """Global Positioning System. //| """Global Positioning System.
//| //|
//| :type gnss.SatelliteSystem:""" //| :type gnss.SatelliteSystem:"""
//| //|
//| GLONASS: Any = ... //| GLONASS: gnss.SatelliteSystem = ...
//| """GLObal NAvigation Satellite System. //| """GLObal NAvigation Satellite System.
//| //|
//| :type gnss.SatelliteSystem:""" //| :type gnss.SatelliteSystem:"""
//| //|
//| SBAS: Any = ... //| SBAS: gnss.SatelliteSystem = ...
//| """Satellite Based Augmentation System. //| """Satellite Based Augmentation System.
//| //|
//| :type gnss.SatelliteSystem:""" //| :type gnss.SatelliteSystem:"""
//| //|
//| QZSS_L1CA: Any = ... //| QZSS_L1CA: gnss.SatelliteSystem = ...
//| """Quasi-Zenith Satellite System L1C/A. //| """Quasi-Zenith Satellite System L1C/A.
//| //|
//| :type gnss.SatelliteSystem:""" //| :type gnss.SatelliteSystem:"""
//| //|
//| QZSS_L1S: Any = ... //| QZSS_L1S: gnss.SatelliteSystem = ...
//| """Quasi-Zenith Satellite System L1S. //| """Quasi-Zenith Satellite System L1S.
//| //|
//| :type gnss.SatelliteSystem:""" //| :type gnss.SatelliteSystem:"""