Skip to content

Commit 310ed95

Browse files
committed
libs2: Lint include
Origin: #136 Signed-off-by: Philippe Coval <[email protected]>
1 parent 7f73667 commit 310ed95

File tree

2 files changed

+124
-74
lines changed

2 files changed

+124
-74
lines changed

include/sl_status.h

Lines changed: 123 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@
2020

2121
#include <stdint.h>
2222

23-
2423
/**
2524
* @defgroup unify_definitions Unify definitions
2625
* @ingroup unify_components
2726
* @brief Type definitions and macros for Unify components and applications.
2827
*/
2928

30-
3129
/**
3230
* @defgroup unify_sl_status_codes Status Codes
3331
* @ingroup unify_definitions
@@ -46,91 +44,143 @@
4644
*************************** GENERIC ERRORS ********************************
4745
******************************************************************************/
4846

49-
#define SL_STATUS_OK ((sl_status_t)0x0000) ///< No error.
50-
#define SL_STATUS_FAIL ((sl_status_t)0x0001) ///< Generic error.
47+
#define SL_STATUS_OK ((sl_status_t)0x0000) ///< No error.
48+
#define SL_STATUS_FAIL ((sl_status_t)0x0001) ///< Generic error.
5149

5250
// State Errors
53-
#define SL_STATUS_INVALID_STATE ((sl_status_t)0x0002) ///< Generic invalid state error.
54-
#define SL_STATUS_NOT_READY ((sl_status_t)0x0003) ///< Module is not ready for requested operation.
55-
#define SL_STATUS_BUSY ((sl_status_t)0x0004) ///< Module is busy and cannot carry out requested operation.
56-
#define SL_STATUS_IN_PROGRESS ((sl_status_t)0x0005) ///< Operation is in progress and not yet complete (pass or fail).
57-
#define SL_STATUS_ABORT ((sl_status_t)0x0006) ///< Operation aborted.
58-
#define SL_STATUS_TIMEOUT ((sl_status_t)0x0007) ///< Operation timed out.
59-
#define SL_STATUS_PERMISSION ((sl_status_t)0x0008) ///< Operation not allowed per permissions.
60-
#define SL_STATUS_WOULD_BLOCK ((sl_status_t)0x0009) ///< Non-blocking operation would block.
61-
#define SL_STATUS_IDLE ((sl_status_t)0x000A) ///< Operation/module is Idle, cannot carry requested operation.
62-
#define SL_STATUS_IS_WAITING ((sl_status_t)0x000B) ///< Operation cannot be done while construct is waiting.
63-
#define SL_STATUS_NONE_WAITING ((sl_status_t)0x000C) ///< No task/construct waiting/pending for that action/event.
64-
#define SL_STATUS_SUSPENDED ((sl_status_t)0x000D) ///< Operation cannot be done while construct is suspended.
65-
#define SL_STATUS_NOT_AVAILABLE ((sl_status_t)0x000E) ///< Feature not available due to software configuration.
66-
#define SL_STATUS_NOT_SUPPORTED ((sl_status_t)0x000F) ///< Feature not supported.
67-
#define SL_STATUS_INITIALIZATION ((sl_status_t)0x0010) ///< Initialization failed.
68-
#define SL_STATUS_NOT_INITIALIZED ((sl_status_t)0x0011) ///< Module has not been initialized.
69-
#define SL_STATUS_ALREADY_INITIALIZED ((sl_status_t)0x0012) ///< Module has already been initialized.
70-
#define SL_STATUS_DELETED ((sl_status_t)0x0013) ///< Object/construct has been deleted.
71-
#define SL_STATUS_ISR ((sl_status_t)0x0014) ///< Illegal call from ISR.
72-
#define SL_STATUS_NETWORK_UP ((sl_status_t)0x0015) ///< Illegal call because network is up.
73-
#define SL_STATUS_NETWORK_DOWN ((sl_status_t)0x0016) ///< Illegal call because network is down.
74-
#define SL_STATUS_NOT_JOINED ((sl_status_t)0x0017) ///< Failure due to not being joined in a network.
75-
#define SL_STATUS_NO_BEACONS ((sl_status_t)0x0018) ///< Invalid operation as there are no beacons.
51+
#define SL_STATUS_INVALID_STATE \
52+
((sl_status_t)0x0002) ///< Generic invalid state error.
53+
#define SL_STATUS_NOT_READY \
54+
((sl_status_t)0x0003) ///< Module is not ready for requested operation.
55+
#define SL_STATUS_BUSY \
56+
((sl_status_t)0x0004) ///< Module is busy and cannot carry out requested operation.
57+
#define SL_STATUS_IN_PROGRESS \
58+
((sl_status_t)0x0005) ///< Operation is in progress and not yet complete (pass or fail).
59+
#define SL_STATUS_ABORT ((sl_status_t)0x0006) ///< Operation aborted.
60+
#define SL_STATUS_TIMEOUT ((sl_status_t)0x0007) ///< Operation timed out.
61+
#define SL_STATUS_PERMISSION \
62+
((sl_status_t)0x0008) ///< Operation not allowed per permissions.
63+
#define SL_STATUS_WOULD_BLOCK \
64+
((sl_status_t)0x0009) ///< Non-blocking operation would block.
65+
#define SL_STATUS_IDLE \
66+
((sl_status_t)0x000A) ///< Operation/module is Idle, cannot carry requested operation.
67+
#define SL_STATUS_IS_WAITING \
68+
((sl_status_t)0x000B) ///< Operation cannot be done while construct is waiting.
69+
#define SL_STATUS_NONE_WAITING \
70+
((sl_status_t)0x000C) ///< No task/construct waiting/pending for that action/event.
71+
#define SL_STATUS_SUSPENDED \
72+
((sl_status_t)0x000D) ///< Operation cannot be done while construct is suspended.
73+
#define SL_STATUS_NOT_AVAILABLE \
74+
((sl_status_t)0x000E) ///< Feature not available due to software configuration.
75+
#define SL_STATUS_NOT_SUPPORTED \
76+
((sl_status_t)0x000F) ///< Feature not supported.
77+
#define SL_STATUS_INITIALIZATION \
78+
((sl_status_t)0x0010) ///< Initialization failed.
79+
#define SL_STATUS_NOT_INITIALIZED \
80+
((sl_status_t)0x0011) ///< Module has not been initialized.
81+
#define SL_STATUS_ALREADY_INITIALIZED \
82+
((sl_status_t)0x0012) ///< Module has already been initialized.
83+
#define SL_STATUS_DELETED \
84+
((sl_status_t)0x0013) ///< Object/construct has been deleted.
85+
#define SL_STATUS_ISR ((sl_status_t)0x0014) ///< Illegal call from ISR.
86+
#define SL_STATUS_NETWORK_UP \
87+
((sl_status_t)0x0015) ///< Illegal call because network is up.
88+
#define SL_STATUS_NETWORK_DOWN \
89+
((sl_status_t)0x0016) ///< Illegal call because network is down.
90+
#define SL_STATUS_NOT_JOINED \
91+
((sl_status_t)0x0017) ///< Failure due to not being joined in a network.
92+
#define SL_STATUS_NO_BEACONS \
93+
((sl_status_t)0x0018) ///< Invalid operation as there are no beacons.
7694

7795
// Allocation/ownership Errors
78-
#define SL_STATUS_ALLOCATION_FAILED ((sl_status_t)0x0019) ///< Generic allocation error.
79-
#define SL_STATUS_NO_MORE_RESOURCE ((sl_status_t)0x001A) ///< No more resource available to perform the operation.
80-
#define SL_STATUS_EMPTY ((sl_status_t)0x001B) ///< Item/list/queue is empty.
81-
#define SL_STATUS_FULL ((sl_status_t)0x001C) ///< Item/list/queue is full.
82-
#define SL_STATUS_WOULD_OVERFLOW ((sl_status_t)0x001D) ///< Item would overflow.
83-
#define SL_STATUS_HAS_OVERFLOWED ((sl_status_t)0x001E) ///< Item/list/queue has been overflowed.
84-
#define SL_STATUS_OWNERSHIP ((sl_status_t)0x001F) ///< Generic ownership error.
85-
#define SL_STATUS_IS_OWNER ((sl_status_t)0x0020) ///< Already/still owning resource.
96+
#define SL_STATUS_ALLOCATION_FAILED \
97+
((sl_status_t)0x0019) ///< Generic allocation error.
98+
#define SL_STATUS_NO_MORE_RESOURCE \
99+
((sl_status_t)0x001A) ///< No more resource available to perform the operation.
100+
#define SL_STATUS_EMPTY ((sl_status_t)0x001B) ///< Item/list/queue is empty.
101+
#define SL_STATUS_FULL ((sl_status_t)0x001C) ///< Item/list/queue is full.
102+
#define SL_STATUS_WOULD_OVERFLOW \
103+
((sl_status_t)0x001D) ///< Item would overflow.
104+
#define SL_STATUS_HAS_OVERFLOWED \
105+
((sl_status_t)0x001E) ///< Item/list/queue has been overflowed.
106+
#define SL_STATUS_OWNERSHIP ((sl_status_t)0x001F) ///< Generic ownership error.
107+
#define SL_STATUS_IS_OWNER \
108+
((sl_status_t)0x0020) ///< Already/still owning resource.
86109

87110
// Invalid Parameters Errors
88-
#define SL_STATUS_INVALID_PARAMETER ((sl_status_t)0x0021) ///< Generic invalid argument or consequence of invalid argument.
89-
#define SL_STATUS_NULL_POINTER ((sl_status_t)0x0022) ///< Invalid null pointer received as argument.
90-
#define SL_STATUS_INVALID_CONFIGURATION ((sl_status_t)0x0023) ///< Invalid configuration provided.
91-
#define SL_STATUS_INVALID_MODE ((sl_status_t)0x0024) ///< Invalid mode.
92-
#define SL_STATUS_INVALID_HANDLE ((sl_status_t)0x0025) ///< Invalid handle.
93-
#define SL_STATUS_INVALID_TYPE ((sl_status_t)0x0026) ///< Invalid type for operation.
94-
#define SL_STATUS_INVALID_INDEX ((sl_status_t)0x0027) ///< Invalid index.
95-
#define SL_STATUS_INVALID_RANGE ((sl_status_t)0x0028) ///< Invalid range.
96-
#define SL_STATUS_INVALID_KEY ((sl_status_t)0x0029) ///< Invalid key.
97-
#define SL_STATUS_INVALID_CREDENTIALS ((sl_status_t)0x002A) ///< Invalid credentials.
98-
#define SL_STATUS_INVALID_COUNT ((sl_status_t)0x002B) ///< Invalid count.
99-
#define SL_STATUS_INVALID_SIGNATURE ((sl_status_t)0x002C) ///< Invalid signature / verification failed.
100-
#define SL_STATUS_NOT_FOUND ((sl_status_t)0x002D) ///< Item could not be found.
101-
#define SL_STATUS_ALREADY_EXISTS ((sl_status_t)0x002E) ///< Item already exists.
111+
#define SL_STATUS_INVALID_PARAMETER \
112+
((sl_status_t)0x0021) ///< Generic invalid argument or consequence of invalid argument.
113+
#define SL_STATUS_NULL_POINTER \
114+
((sl_status_t)0x0022) ///< Invalid null pointer received as argument.
115+
#define SL_STATUS_INVALID_CONFIGURATION \
116+
((sl_status_t)0x0023) ///< Invalid configuration provided.
117+
#define SL_STATUS_INVALID_MODE ((sl_status_t)0x0024) ///< Invalid mode.
118+
#define SL_STATUS_INVALID_HANDLE ((sl_status_t)0x0025) ///< Invalid handle.
119+
#define SL_STATUS_INVALID_TYPE \
120+
((sl_status_t)0x0026) ///< Invalid type for operation.
121+
#define SL_STATUS_INVALID_INDEX ((sl_status_t)0x0027) ///< Invalid index.
122+
#define SL_STATUS_INVALID_RANGE ((sl_status_t)0x0028) ///< Invalid range.
123+
#define SL_STATUS_INVALID_KEY ((sl_status_t)0x0029) ///< Invalid key.
124+
#define SL_STATUS_INVALID_CREDENTIALS \
125+
((sl_status_t)0x002A) ///< Invalid credentials.
126+
#define SL_STATUS_INVALID_COUNT ((sl_status_t)0x002B) ///< Invalid count.
127+
#define SL_STATUS_INVALID_SIGNATURE \
128+
((sl_status_t)0x002C) ///< Invalid signature / verification failed.
129+
#define SL_STATUS_NOT_FOUND ((sl_status_t)0x002D) ///< Item could not be found.
130+
#define SL_STATUS_ALREADY_EXISTS \
131+
((sl_status_t)0x002E) ///< Item already exists.
102132

103133
// IO/Communication Errors
104-
#define SL_STATUS_IO ((sl_status_t)0x002F) ///< Generic I/O failure.
105-
#define SL_STATUS_IO_TIMEOUT ((sl_status_t)0x0030) ///< I/O failure due to timeout.
106-
#define SL_STATUS_TRANSMIT ((sl_status_t)0x0031) ///< Generic transmission error.
107-
#define SL_STATUS_TRANSMIT_UNDERFLOW ((sl_status_t)0x0032) ///< Transmit underflowed.
108-
#define SL_STATUS_TRANSMIT_INCOMPLETE ((sl_status_t)0x0033) ///< Transmit is incomplete.
109-
#define SL_STATUS_TRANSMIT_BUSY ((sl_status_t)0x0034) ///< Transmit is busy.
110-
#define SL_STATUS_RECEIVE ((sl_status_t)0x0035) ///< Generic reception error.
111-
#define SL_STATUS_OBJECT_READ ((sl_status_t)0x0036) ///< Failed to read on/via given object.
112-
#define SL_STATUS_OBJECT_WRITE ((sl_status_t)0x0037) ///< Failed to write on/via given object.
113-
#define SL_STATUS_MESSAGE_TOO_LONG ((sl_status_t)0x0038) ///< Message is too long.
134+
#define SL_STATUS_IO ((sl_status_t)0x002F) ///< Generic I/O failure.
135+
#define SL_STATUS_IO_TIMEOUT \
136+
((sl_status_t)0x0030) ///< I/O failure due to timeout.
137+
#define SL_STATUS_TRANSMIT \
138+
((sl_status_t)0x0031) ///< Generic transmission error.
139+
#define SL_STATUS_TRANSMIT_UNDERFLOW \
140+
((sl_status_t)0x0032) ///< Transmit underflowed.
141+
#define SL_STATUS_TRANSMIT_INCOMPLETE \
142+
((sl_status_t)0x0033) ///< Transmit is incomplete.
143+
#define SL_STATUS_TRANSMIT_BUSY ((sl_status_t)0x0034) ///< Transmit is busy.
144+
#define SL_STATUS_RECEIVE ((sl_status_t)0x0035) ///< Generic reception error.
145+
#define SL_STATUS_OBJECT_READ \
146+
((sl_status_t)0x0036) ///< Failed to read on/via given object.
147+
#define SL_STATUS_OBJECT_WRITE \
148+
((sl_status_t)0x0037) ///< Failed to write on/via given object.
149+
#define SL_STATUS_MESSAGE_TOO_LONG \
150+
((sl_status_t)0x0038) ///< Message is too long.
114151

115152
// ANSI C/POSIX codes
116-
#define SL_STATUS_ERRNO ((sl_status_t)0x0101) ///< System error: errno is set and strerror can be used to fetch the error-message.
153+
#define SL_STATUS_ERRNO \
154+
((sl_status_t)0x0101) ///< System error: errno is set and strerror can be used to fetch the error-message.
117155

118156
// Net-MQTT status codes
119-
#define SL_STATUS_NET_MQTT_NO_CONN ((sl_status_t)0x0841) ///< Not connected to a broker.
120-
#define SL_STATUS_NET_MQTT_LOST_CONN ((sl_status_t)0x0842) ///< Connection to broker lost.
121-
#define SL_STATUS_NET_MQTT_PROTOCOL ((sl_status_t)0x0843) ///< Protocol error.
122-
#define SL_STATUS_NET_MQTT_TLS_HANDSHAKE ((sl_status_t)0x0844) ///< TLS negotiation failed.
123-
#define SL_STATUS_NET_MQTT_PAYLOAD_SIZE ((sl_status_t)0x0845) ///< Payload size is too large.
124-
#define SL_STATUS_NET_MQTT_NOT_SUPPORTED ((sl_status_t)0x0846) ///< MQTTv5 properties are set but client is not using MQTTv5.
125-
#define SL_STATUS_NET_MQTT_AUTH ((sl_status_t)0x0847) ///< Authentication failed.
126-
#define SL_STATUS_NET_MQTT_ACL_DENIED ((sl_status_t)0x0848) ///< Access control list deny.
127-
#define SL_STATUS_NET_MQTT_MALFORMED_UTF8 ((sl_status_t)0x0849) ///< Malformed UTF-8 string in the specified MQTT-topic.
128-
#define SL_STATUS_NET_MQTT_DUPLICATE_PROPERTY ((sl_status_t)0x084A) ///< An MQTTv5 property is duplicated where it is forbidden.
129-
#define SL_STATUS_NET_MQTT_QOS_NOT_SUPPORTED ((sl_status_t)0x084B) ///< The requested QoS level is not supported by the broker.
130-
#define SL_STATUS_NET_MQTT_OVERSIZE_PACKET ((sl_status_t)0x084C) ///< Resulting packet will become larger than the broker supports.
157+
#define SL_STATUS_NET_MQTT_NO_CONN \
158+
((sl_status_t)0x0841) ///< Not connected to a broker.
159+
#define SL_STATUS_NET_MQTT_LOST_CONN \
160+
((sl_status_t)0x0842) ///< Connection to broker lost.
161+
#define SL_STATUS_NET_MQTT_PROTOCOL ((sl_status_t)0x0843) ///< Protocol error.
162+
#define SL_STATUS_NET_MQTT_TLS_HANDSHAKE \
163+
((sl_status_t)0x0844) ///< TLS negotiation failed.
164+
#define SL_STATUS_NET_MQTT_PAYLOAD_SIZE \
165+
((sl_status_t)0x0845) ///< Payload size is too large.
166+
#define SL_STATUS_NET_MQTT_NOT_SUPPORTED \
167+
((sl_status_t)0x0846) ///< MQTTv5 properties are set but client is not using MQTTv5.
168+
#define SL_STATUS_NET_MQTT_AUTH \
169+
((sl_status_t)0x0847) ///< Authentication failed.
170+
#define SL_STATUS_NET_MQTT_ACL_DENIED \
171+
((sl_status_t)0x0848) ///< Access control list deny.
172+
#define SL_STATUS_NET_MQTT_MALFORMED_UTF8 \
173+
((sl_status_t)0x0849) ///< Malformed UTF-8 string in the specified MQTT-topic.
174+
#define SL_STATUS_NET_MQTT_DUPLICATE_PROPERTY \
175+
((sl_status_t)0x084A) ///< An MQTTv5 property is duplicated where it is forbidden.
176+
#define SL_STATUS_NET_MQTT_QOS_NOT_SUPPORTED \
177+
((sl_status_t)0x084B) ///< The requested QoS level is not supported by the broker.
178+
#define SL_STATUS_NET_MQTT_OVERSIZE_PACKET \
179+
((sl_status_t)0x084C) ///< Resulting packet will become larger than the broker supports.
131180

132181
// Other codes
133-
#define SL_STATUS_PRINT_INFO_MESSAGE ((sl_status_t)0x0900) ///< Only information message should be printed, without starting an application
182+
#define SL_STATUS_PRINT_INFO_MESSAGE \
183+
((sl_status_t)0x0900) ///< Only information message should be printed, without starting an application
134184

135185
/*
136186
******************************** DATA TYPES *******************************

include/uic_enum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* my_type_enum y; //<< this will be of enum type
3737
*/
3838
#define UIC_ENUM(name, type) \
39-
name_enum; \
39+
name_enum; \
4040
typedef type name
4141

4242
/**

0 commit comments

Comments
 (0)