Skip to content

Commit bf7173d

Browse files
committed
bsdlib: release 0.5.0
* `bsd_irrecoverable_error_handler()` has been removed. The application now longer needs to implement it to receive errors during initialization, which are instead reported via `bsd_init()`. * `bsd_shutdown()` now returns an integer. * Added RAW socket support. * Added missing AGPS data models. * Added APGS nofification support. * Fixed an issue where AGPS data can not be written when the GPS socket is in stopped state * Fixed a memory leak in the GPS socket Internal revision: 4303c58ecf7 Signed-off-by: Emanuele Di Santo <[email protected]> Signed-off-by: Bartosz Gentkowski <[email protected]>
1 parent a751b47 commit bf7173d

File tree

5 files changed

+107
-34
lines changed

5 files changed

+107
-34
lines changed

bsdlib/CHANGELOG.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Changelog
55

66
All notable changes to this project are documented in this file.
77

8+
bsdlib 0.5.0
9+
************
10+
11+
* :cpp:func:`bsd_irrecoverable_handler()` has been removed.
12+
The application no longer needs to implement it to receive errors during initialization, which are instead reported via :cpp:func:`bsd_init()`.
13+
* :cpp:func:`bsd_shutdown()` now returns an integer.
14+
* Added RAW socket support.
15+
* Added missing AGPS data models.
16+
* Added APGS notification support.
17+
* Fixed an issue where AGPS data could not be written when the GPS socket was in stopped state.
18+
* Fixed a memory leak in GPS socket.
19+
20+
821
bsdlib 0.4.3
922
************
1023

bsdlib/include/bsd.h

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@
99
* @defgroup bsd BSD Library Management
1010
* @ingroup bsd_library
1111
* @{
12-
* @brief Application Interface offered for management of BSD Library.
12+
* @brief Application interface offered for management of BSD Library.
1313
*/
1414
#ifndef BSD_H__
1515
#define BSD_H__
1616

1717
#include <stdint.h>
1818

19-
#include "bsd_limits.h"
20-
2119
#ifdef __cplusplus
2220
extern "C" {
2321
#endif
2422

23+
/**
24+
* @defgroup bsd_modem_dfu
25+
* @c bsd_init() return values when executing Modem firmware updates.
26+
*
27+
* @ingroup bsd_library
28+
* @{
29+
*/
2530

2631
/** Modem firmware update successful.
2732
* The modem will run the updated firmware on reboot.
@@ -46,57 +51,44 @@ extern "C" {
4651
*/
4752
#define MODEM_DFU_RESULT_UUID_ERROR 0x4400004u
4853

54+
/**@} */
55+
4956
/**
50-
* @brief Method to initialize BSD library.
51-
*
52-
* @details This method shall be called before using any of the other methods of the application.
53-
* In case the initialization fails, the call results in a hard fault.
54-
*
55-
* This method shall be called once. Calling this method again with a shutdown results
56-
* in undefined behavior.
57+
* @brief Initialize the library.
5758
*
58-
* Initializing the library results in reserving resources defined in bsd_platform.h on
59-
* the system. The application shall not use any of the resources identified in
60-
* bsd_platform.h.
59+
* Once initialized, the library uses the resources defined in bsd_platform.h.
6160
*
62-
* @return Zero on success or an error code otherwise.
61+
* @retval Zero on success.
62+
* @retval A positive value from @ref bsd_modem_dfu when executing
63+
* Modem firmware updates.
64+
* @retval -1 on error.
6365
*/
6466
int bsd_init(void);
6567

6668

6769
/**
68-
* @brief Method to gracefully shutdown the BSD library.
70+
* @brief Shutdown the library.
6971
*
70-
* @details This method used to shutdown the library. Resources reserved by the system may be reused
71-
* once the library is gracefully shutdown.
72-
*/
73-
void bsd_shutdown(void);
74-
75-
76-
/**
77-
* @brief Handler for recoverable BSD library errors.
78-
*
79-
* @note It can be overwritten by the application.
80-
* The default will hard fault.
72+
* Resources reserved by the library in bsd_platform.h are freed when
73+
* the library is shutdown.
8174
*
82-
* @param[in] error Indicates the error that occurred.
75+
* @retval Zero on success.
76+
* @retval -1 on error.
8377
*/
84-
extern void bsd_recoverable_error_handler(uint32_t error);
78+
int bsd_shutdown(void);
8579

8680

8781
/**
88-
* @brief Handler for irrecoverable BSD library errors.
89-
*
90-
* @note It can be overwritten by the application.
91-
* The default will hard fault.
82+
* @brief Handler for BSD library errors.
9283
*
93-
* @param[in] error Indicates the error that occurred.
84+
* @param[in] error The error reason.
9485
*/
95-
extern void bsd_irrecoverable_error_handler(uint32_t error);
86+
extern void bsd_recoverable_error_handler(uint32_t error);
9687

9788
#ifdef __cplusplus
9889
}
9990
#endif
10091

10192
#endif // BSD_H__
93+
10294
/**@} */

bsdlib/include/nrf_socket.h

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ typedef int32_t ssize_t;
7373
*/
7474
#define NRF_AF_LOCAL 1 /**< Family to identify protocols/operations local to Nordic device. */
7575
#define NRF_AF_INET 2 /**< IPv4 socket family. */
76+
#define NRF_AF_PACKET 5 /**< Raw packet family. */
7677
#define NRF_AF_INET6 10 /**< IPv6 socket family. */
7778
#define NRF_AF_LTE 102 /**< Nordic proprietary LTE socket family. */
7879
/**@} */
@@ -83,6 +84,7 @@ typedef int32_t ssize_t;
8384
*/
8485
#define NRF_SOCK_STREAM 1 /**< TCP socket type. */
8586
#define NRF_SOCK_DGRAM 2 /**< UDP socket type. */
87+
#define NRF_SOCK_RAW 3 /**< RAW socket type. */
8688
/**@} */
8789

8890
/**@defgroup nrf_socket_mgmt_types Nordic specific extensions of nrf_socket_type_t
@@ -197,6 +199,8 @@ typedef int32_t ssize_t;
197199
#define NRF_GNSS_AGPS_KLOBUCHAR_IONOSPHERIC_CORRECTION 4 /**< GPS ionospheric assistance AGPS parameters, Klobuchar model. */
198200
#define NRF_GNSS_AGPS_NEQUICK_IONOSPHERIC_CORRECTION 5 /**< GPS ionospheric assistance AGPS parameters, NeQuick model. */
199201
#define NRF_GNSS_AGPS_GPS_SYSTEM_CLOCK_AND_TOWS 6 /**< GPS system time and SV TOW assistance AGPS parameter. */
202+
#define NRF_GNSS_AGPS_LOCATION 7 /**< GPS location assistance AGPS parameters */
203+
#define NRF_GNSS_AGPS_INTEGRITY 8 /**< GPS integrity assistance AGPS parameters */
200204
/** @} */
201205

202206
/**@defgroup nrf_nmea_str_mask Set of values (as bitmask) to enable NMEA output strings
@@ -591,8 +595,16 @@ typedef struct
591595

592596
typedef char nrf_gnss_nmea_data_frame_t[NRF_GNSS_NMEA_MAX_LEN];
593597

598+
typedef struct
599+
{
600+
uint32_t sv_mask_ephe;
601+
uint32_t sv_mask_alm;
602+
uint32_t data_flags;
603+
} nrf_gnss_agps_data_frame_t;
604+
594605
#define NRF_GNSS_PVT_DATA_ID 1
595606
#define NRF_GNSS_NMEA_DATA_ID 2
607+
#define NRF_GNSS_AGPS_DATA_ID 3
596608

597609
typedef struct
598610
{
@@ -601,6 +613,7 @@ typedef struct
601613
{
602614
nrf_gnss_pvt_data_frame_t pvt;
603615
nrf_gnss_nmea_data_frame_t nmea;
616+
nrf_gnss_agps_data_frame_t agps;
604617
};
605618
} nrf_gnss_data_frame_t;
606619

@@ -622,6 +635,8 @@ typedef struct
622635
* - @c NRF_GNSS_AGPS_KLOBUCHAR_IONOSPHERIC_CORRECTION
623636
* - @c NRF_GNSS_AGPS_NEQUICK_IONOSPHERIC_CORRECTION
624637
* - @c NRF_GNSS_AGPS_GPS_SYSTEM_CLOCK_AND_TOWS
638+
* - @c NRF_GNSS_AGPS_LOCATION
639+
* - @c NRF_GNSS_AGPS_INTEGRITY
625640
*/
626641
typedef uint16_t nrf_gnss_agps_data_type_t;
627642

@@ -724,6 +739,59 @@ typedef struct
724739
nrf_gnss_agps_data_tow_element_t sv_tow[NRF_GNSS_AGPS_MAX_SV_TOW]; /**< TOW assistance data for PRN n */
725740
} nrf_gnss_agps_data_system_time_and_sv_tow_t;
726741

742+
typedef struct
743+
{
744+
int32_t latitude; /**< Geodetic latitude in WGS-84. Range -8388607...8388607.
745+
* The relation between the coded number N and the latitude
746+
* range X (in degrees) is as follows: N <= (2^24/360) * X < N + 1.
747+
* For N = 2^23 - 1, the range is extended to include N+1.
748+
* Range of X (in degrees) -90...90.
749+
*/
750+
751+
int32_t longitude; /**< Geodetic longitude in WGS-84. Range -8388607..8388607.
752+
* The relation between the coded number N and the longitude range
753+
* X (in degrees) is as follows: N <= (2^24/360) * X < N + 1.
754+
* Range of X (in degrees) -180...180.
755+
*/
756+
757+
int16_t altitude; /**< Altitude. Above (positive value) or below (negative value) WGS-84
758+
* ellipsoid surface. Range -32767...32767.
759+
* The relation between the coded number N and the altitude range a
760+
* (in meters) is as follows: N <= a < N + 1.
761+
* For N = 2^15 - 1 the range is extended to include all greater values of a.
762+
*/
763+
764+
uint8_t unc_semimajor; /**< Uncertainty, semi-major. Range 0...127. The uncertainty (in meters) is
765+
* mapped from the coded number K with following formula: r = C * (K - 1),
766+
* where C = 10 and x = 0,1. Range of r (in kilometers) 0...1800.
767+
*/
768+
769+
uint8_t unc_semiminor; /**< Uncertainty, semi-minor. Range 0...127. The uncertainty (in meters) is
770+
* mapped from the coded number K with following formula: r = C * (K - 1),
771+
* where C = 10 and x = 0,1. Range of r (in kilometers) 0...1800)
772+
*/
773+
774+
uint8_t orientation_major; /**< Orientation angle between the major axis and north. Range in degrees 0...179. */
775+
776+
uint8_t unc_altitude; /**< Uncertainty, altitude. Range 0...127. The uncertainty in altitude h (in meters)
777+
* is mapped from the coded number K with following formula: h = C * (K - 1).
778+
* where C = 45 and x = 0,025. Range of h (in meters) 0...990,5.
779+
*/
780+
781+
uint8_t confidence; /**< The confidence level (expressed as a percentage) with which
782+
* the position of a target entity is included within the uncertainty ellipsoid.
783+
* Range 0...128. '0' indicates 'no information'. Values 101..128 should be treated as '0'.
784+
*/
785+
} nrf_gnss_agps_data_location_t;
786+
787+
788+
typedef struct
789+
{
790+
uint32_t integrity_mask; /**< Bit mask indicating the unhealthy GPS satellite PRNs. When a mask bit is set,
791+
* the corresponding GPS satellite PRN is unhealthy.
792+
*/
793+
} nrf_gnss_agps_data_integrity_t;
794+
727795
/** @} */
728796

729797
/**@defgroup nrf_socketopt_gnss GNSS socket option
454 Bytes
Binary file not shown.
454 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)