Skip to content

Commit 5609995

Browse files
Ran astyle on COMPONENT_SCL.
1 parent 89c70fb commit 5609995

File tree

12 files changed

+141
-174
lines changed

12 files changed

+141
-174
lines changed

features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_SCL/interface/SclSTAInterface.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ struct scl_tx_nw_credentials {
3737
nsapi_security_t network_security_type;
3838
int ssid_len;
3939
int pass_len;
40-
const char* network_ssid;
41-
const char* network_passphrase;
40+
const char *network_ssid;
41+
const char *network_passphrase;
4242
} scl_tx_nw_credentials_t;
4343

4444
network_params_t network_parameter;
@@ -186,9 +186,9 @@ nsapi_error_t SclSTAInterface::connect()
186186
scl_tx_nw_credentials_t.pass_len = strlen(_pass);
187187
}
188188
scl_tx_nw_credentials_t.network_security_type = _security;
189-
190-
ret_val = scl_send_data(SCL_TX_CONNECT, (char*)&scl_tx_nw_credentials_t, TIMER_DEFAULT_VALUE);
191-
189+
190+
ret_val = scl_send_data(SCL_TX_CONNECT, (char *)&scl_tx_nw_credentials_t, TIMER_DEFAULT_VALUE);
191+
192192
if (ret_val == SCL_SUCCESS) {
193193
SCL_LOG(("wifi provisioning in progress"));
194194
}
@@ -202,15 +202,15 @@ nsapi_error_t SclSTAInterface::connect()
202202
wait_us(NW_DELAY_TIME_US);
203203
delay_timeout++;
204204
}
205-
205+
206206
if (delay_timeout >= NW_CONNECT_TIMEOUT || ret_val != SCL_SUCCESS) {
207207
return NSAPI_ERROR_NO_CONNECTION;
208208
}
209-
209+
210210
if (!_scl_emac.powered_up) {
211211
_scl_emac.power_up();
212212
}
213-
213+
214214
if (!_interface) {
215215
nsapi_error_t err = _stack.add_ethernet_interface(_emac, true, &_interface);
216216
if (err != NSAPI_ERROR_OK) {
@@ -225,12 +225,12 @@ nsapi_error_t SclSTAInterface::connect()
225225
}
226226

227227
interface_status = _interface->bringup(false,
228-
network_parameter.ip_address,
229-
network_parameter.netmask,
230-
network_parameter.gateway,
231-
DEFAULT_STACK);
228+
network_parameter.ip_address,
229+
network_parameter.netmask,
230+
network_parameter.gateway,
231+
DEFAULT_STACK);
232232

233-
scl_send_data(SCL_TX_CONNECTION_STATUS, (char*)&connection_status, TIMER_DEFAULT_VALUE);
233+
scl_send_data(SCL_TX_CONNECTION_STATUS, (char *)&connection_status, TIMER_DEFAULT_VALUE);
234234

235235
return interface_status;
236236
}
@@ -246,12 +246,12 @@ nsapi_error_t SclSTAInterface::disconnect()
246246
{
247247
scl_result_t ret_val;
248248
nsapi_error_t disconnect_status;
249-
ret_val = scl_send_data(SCL_TX_DISCONNECT, (char*)&disconnect_status, TIMER_DEFAULT_VALUE);
250-
249+
ret_val = scl_send_data(SCL_TX_DISCONNECT, (char *)&disconnect_status, TIMER_DEFAULT_VALUE);
250+
251251
if (ret_val == SCL_ERROR) {
252252
return NSAPI_ERROR_TIMEOUT;
253253
}
254-
254+
255255
if (!_interface) {
256256
return NSAPI_STATUS_DISCONNECTED;
257257
}
@@ -303,19 +303,18 @@ int SclSTAInterface::get_bssid(uint8_t *bssid)
303303
{
304304
scl_mac_t ap_mac;
305305
scl_result_t res = SCL_SUCCESS;
306-
306+
307307
if (bssid == NULL) {
308308
return SCL_BADARG;
309309
}
310-
310+
311311
memset(&ap_mac, 0, sizeof(ap_mac));
312312
if (scl_wifi_is_ready_to_transceive() == SCL_SUCCESS) {
313313
res = (scl_result_t) scl_wifi_get_bssid(&ap_mac);
314314
if (res == SCL_SUCCESS) {
315315
memcpy(bssid, ap_mac.octet, sizeof(ap_mac.octet));
316316
}
317-
}
318-
else {
317+
} else {
319318
return SCL_CONNECTION_LOST;
320319
}
321320
return res;

features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_SCL/interface/SclSTAInterface.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ class SclSTAInterface : public WiFiInterface, public EMACInterface {
4141
SclSTAInterface(
4242
SCL_EMAC &emac = SCL_EMAC::get_instance(),
4343
OnboardNetworkStack &stack = OnboardNetworkStack::get_default_instance());
44-
44+
4545
/** Gets the current instance of the SclSTAInterface
4646
*
4747
* @return Pointer to the object of class SclSTAInterface.
4848
*/
49-
static SclSTAInterface *get_default_instance();
50-
51-
/** Turns on the Wi-Fi device
49+
static SclSTAInterface *get_default_instance();
50+
51+
/** Turns on the Wi-Fi device
5252
*
5353
* @return void
5454
*/
@@ -106,7 +106,7 @@ class SclSTAInterface : public WiFiInterface, public EMACInterface {
106106
return 0;
107107
}
108108

109-
/** Set blocking status of interface.
109+
/** Set blocking status of interface.
110110
* Nonblocking mode is not supported.
111111
*
112112
* @param blocking True if connect is blocking

features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_SCL/interface/scl_emac.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void SCL_EMAC::power_down()
8888

8989
bool SCL_EMAC::power_up()
9090
{
91-
if (!powered_up) {
91+
if (!powered_up) {
9292
if (scl_wifi_on() != true) {
9393
SCL_LOG(("returning False in scl_wifi_on()\n"));
9494
return false;
@@ -106,14 +106,13 @@ bool SCL_EMAC::get_hwaddr(uint8_t *addr) const
106106
scl_mac_t mac;
107107
scl_result_t res = scl_wifi_get_mac_address(&mac);
108108
if (res == SCL_SUCCESS) {
109-
memcpy(addr, mac.octet, sizeof(mac.octet));
110-
return true;
111-
}
112-
else {
113-
SCL_LOG(("return False in SCL_EMAC::gethwaddr\n"));
114-
return false;
115-
}
116-
109+
memcpy(addr, mac.octet, sizeof(mac.octet));
110+
return true;
111+
} else {
112+
SCL_LOG(("return False in SCL_EMAC::gethwaddr\n"));
113+
return false;
114+
}
115+
117116
}
118117

119118
void SCL_EMAC::set_hwaddr(const uint8_t *addr)
@@ -154,7 +153,7 @@ bool SCL_EMAC::link_out(emac_mem_buf_t *buf)
154153
retval = scl_network_send_ethernet_data(scl_tx_data);
155154
if (retval != SCL_SUCCESS) {
156155
return false;
157-
}
156+
}
158157
memory_manager->free(buf);
159158
return true;
160159
}

features/netsocket/emac-drivers/TARGET_Cypress/COMPONENT_SCL/interface/scl_emac.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ class SCL_EMAC : public EMAC {
7070
/**
7171
* Returns the interface name
7272
*
73-
* @param name Pointer to the location where the name should be written.
74-
* @param size Maximum number of characters to copy.
73+
* @param name Pointer to the location where the name should be written.
74+
* @param size Maximum number of characters to copy.
7575
*/
7676
virtual void get_ifname(char *name, uint8_t size) const;
7777

7878
/**
7979
* Returns the size of the underlying interface HW address size.
8080
*
81-
* @return HW address size in bytes.
81+
* @return HW address size in bytes.
8282
*/
8383
virtual uint8_t get_hwaddr_size() const;
8484

8585
/**
8686
* Returns the interface supplied HW address
8787
* Copies the HW address to the provided memory
88-
* @param addr HW address of the underlying interface. It must be of correct size. See @a get_hwaddr_size.
89-
* @return True if HW address is available.
88+
* @param addr HW address of the underlying interface. It must be of correct size. See @a get_hwaddr_size.
89+
* @return True if HW address is available.
9090
*/
9191
virtual bool get_hwaddr(uint8_t *addr) const;
9292

@@ -99,7 +99,7 @@ class SCL_EMAC : public EMAC {
9999
* the stack would normally use that, but it could be overridden for test
100100
* purposes.
101101
*
102-
* @param addr Address to be set
102+
* @param addr Address to be set
103103
*/
104104
virtual void set_hwaddr(const uint8_t *addr);
105105

@@ -108,8 +108,8 @@ class SCL_EMAC : public EMAC {
108108
*
109109
* This cannot be called from an interrupt context.
110110
*
111-
* @param buf Packet to be sent.
112-
* @return True if the packet was sent successfully. False otherwise.
111+
* @param buf Packet to be sent.
112+
* @return True if the packet was sent successfully. False otherwise.
113113
*/
114114
virtual bool link_out(emac_mem_buf_t *buf);
115115

@@ -128,45 +128,45 @@ class SCL_EMAC : public EMAC {
128128
/**
129129
* Sets a callback that is called for packets received for a given interface
130130
*
131-
* @param input_cb Function to be registered as a callback.
131+
* @param input_cb Function to be registered as a callback.
132132
*/
133133
virtual void set_link_input_cb(emac_link_input_cb_t input_cb);
134134

135135
/**
136136
* Sets a callback that is called on changes in the link status for a given interface
137137
*
138-
* @param state_cb Function to be registered as a callback.
138+
* @param state_cb Function to be registered as a callback.
139139
*/
140140
virtual void set_link_state_cb(emac_link_state_change_cb_t state_cb);
141141

142142
/** Adds a device to a multicast group
143143
*
144-
* @param address A multicast group hardware address.
144+
* @param address A multicast group hardware address.
145145
*/
146146
virtual void add_multicast_group(const uint8_t *address);
147147

148148
/** Removes a device from a multicast group
149149
*
150-
* @param address A multicast group hardware address.
150+
* @param address A multicast group hardware address.
151151
*/
152152
virtual void remove_multicast_group(const uint8_t *address);
153153

154154
/** Requests reception of all multicast packets
155155
*
156-
* @param all True to receive all multicasts.
157-
* False to receive only multicasts addressed to specified groups.
156+
* @param all True to receive all multicasts.
157+
* False to receive only multicasts addressed to specified groups.
158158
*/
159159
virtual void set_all_multicast(bool all);
160160

161161
/** Sets memory manager used to handle memory buffers
162162
*
163-
* @param mem_mngr Pointer to memory manager.
163+
* @param mem_mngr Pointer to memory manager.
164164
*/
165165
virtual void set_memory_manager(EMACMemoryManager &mem_mngr);
166166

167167
/** Sets callback to receive EMAC activity events
168168
*
169-
* @param activity_cb The callback for activity events.
169+
* @param activity_cb The callback for activity events.
170170
*/
171171
virtual void set_activity_cb(mbed::Callback<void(bool is_tx_activity)> activity_cb);
172172

@@ -182,7 +182,7 @@ class SCL_EMAC : public EMAC {
182182
};
183183
/** Sends the change in network connection state to network stack
184184
*
185-
* @param state_up Connection status.
185+
* @param state_up Connection status.
186186
*/
187187
extern "C" void scl_emac_wifi_link_state_changed(bool state_up);
188188

targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/inc/scl_common.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,15 @@ typedef uint32_t scl_result_t;
151151
/**
152152
* Typedef for SCL boolean flags
153153
*/
154-
typedef enum
155-
{
154+
typedef enum {
156155
SCL_FALSE = 0, /**< Boolean False */
157156
SCL_TRUE = 1 /**< Boolean True */
158157
} scl_bool_t;
159158

160159
/**
161160
* Typedef for SCL interface roles
162161
*/
163-
typedef enum
164-
{
162+
typedef enum {
165163
SCL_INVALID_ROLE = 0, /**< Invalid role */
166164
SCL_STA_ROLE = 1, /**< STA or Client Interface */
167165
SCL_AP_ROLE = 2, /**< softAP Interface */
@@ -171,8 +169,7 @@ typedef enum
171169
/**
172170
* Typedef for SCL IPC receive index
173171
*/
174-
typedef enum
175-
{
172+
typedef enum {
176173
SCL_RX_DATA = 0, /**< Received buffer */
177174
SCL_RX_TEST_MSG = 1, /**< Test message */
178175
SCL_RX_GET_BUFFER = 2, /**< Get the buffer */
@@ -182,8 +179,7 @@ typedef enum
182179
/**
183180
* Typedef for SCL IPC transmit index
184181
*/
185-
typedef enum
186-
{
182+
typedef enum {
187183
SCL_TX_TEST_MSG = 1, /**< Test Message */
188184
SCL_TX_WIFI_INIT = 2, /**< Initialize Wi-Fi */
189185
SCL_TX_CONFIG_PARAMETERS = 3, /**< Configuration parameters */
@@ -205,8 +201,7 @@ typedef enum
205201
/**
206202
* Structure for storing a MAC address (Wi-Fi Media Access Control address).
207203
*/
208-
typedef struct
209-
{
204+
typedef struct {
210205
uint8_t octet[6]; /**< Unique 6-byte MAC address */
211206
} scl_mac_t;
212207

targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/inc/scl_ipc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typedef struct network_params {
7373
char netmask[PARAM_LEN]; /**< Netmask */
7474
char gateway[PARAM_LEN]; /**< Gateway */
7575
int connection_status; /**< Connection status */
76-
}network_params_t;
76+
} network_params_t;
7777

7878
/******************************************************
7979
* Function Declarations
@@ -94,7 +94,7 @@ extern scl_result_t scl_init(void);
9494
*
9595
* @param index Index of the command.
9696
* @param buffer Data to be sent.
97-
* @param timeout The maximum time (in ms) to wait for the Network Processor to release IPC channel.
97+
* @param timeout The maximum time (in ms) to wait for the Network Processor to release IPC channel.
9898
*
9999
* @return SCL_SUCCESS on successful communication within SCL timeout duration or SCL_ERROR
100100
*/

targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/inc/scl_types.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ extern "C"
7878
/**
7979
* Enumeration of Wi-Fi security modes
8080
*/
81-
typedef enum
82-
{
81+
typedef enum {
8382
SCL_SECURITY_OPEN = 0, /**< Open security */
8483
SCL_SECURITY_WEP_PSK = WEP_ENABLED, /**< WEP PSK Security with open authentication */
8584
SCL_SECURITY_WEP_SHARED = (WEP_ENABLED | SHARED_ENABLED), /**< WEP PSK Security with shared authentication */
@@ -92,21 +91,21 @@ typedef enum
9291
SCL_SECURITY_WPA2_FBT_PSK = (WPA2_SECURITY | AES_ENABLED | FBT_ENABLED), /**< WPA2 FBT PSK Security with AES & TKIP */
9392
SCL_SECURITY_WPA3_SAE = (WPA3_SECURITY | AES_ENABLED), /**< WPA3 Security with AES */
9493
SCL_SECURITY_WPA3_WPA2_PSK = (WPA3_SECURITY | WPA2_SECURITY | AES_ENABLED), /**< WPA3 WPA2 PSK Security with AES */
95-
94+
9695
SCL_SECURITY_WPA_TKIP_ENT = (ENTERPRISE_ENABLED | WPA_SECURITY | TKIP_ENABLED), /**< WPA Enterprise Security with TKIP */
9796
SCL_SECURITY_WPA_AES_ENT = (ENTERPRISE_ENABLED | WPA_SECURITY | AES_ENABLED), /**< WPA Enterprise Security with AES */
9897
SCL_SECURITY_WPA_MIXED_ENT = (ENTERPRISE_ENABLED | WPA_SECURITY | AES_ENABLED | TKIP_ENABLED), /**< WPA Enterprise Security with AES & TKIP */
9998
SCL_SECURITY_WPA2_TKIP_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | TKIP_ENABLED), /**< WPA2 Enterprise Security with TKIP */
10099
SCL_SECURITY_WPA2_AES_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED), /**< WPA2 Enterprise Security with AES */
101100
SCL_SECURITY_WPA2_MIXED_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED | TKIP_ENABLED), /**< WPA2 Enterprise Security with AES & TKIP */
102101
SCL_SECURITY_WPA2_FBT_ENT = (ENTERPRISE_ENABLED | WPA2_SECURITY | AES_ENABLED | FBT_ENABLED), /**< WPA2 Enterprise Security with AES & FBT */
103-
102+
104103
SCL_SECURITY_IBSS_OPEN = (IBSS_ENABLED), /**< Open security on IBSS ad-hoc network */
105104
SCL_SECURITY_WPS_OPEN = (WPS_ENABLED), /**< WPS with open security */
106105
SCL_SECURITY_WPS_SECURE = (WPS_ENABLED | AES_ENABLED), /**< WPS with AES security */
107-
106+
108107
SCL_SECURITY_UNKNOWN = -1, /**< Returned by scan function if security is unknown. Do not pass this to the join function! */
109-
108+
110109
SCL_SECURITY_FORCE_32_BIT = 0x7fffffff /**< Exists only to force scl_security_t type to 32 bits */
111110
} scl_security_t;
112111

targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/inc/scl_wifi_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct scl_tx_buf {
6060
extern bool scl_wifi_on(void);
6161

6262
/** Brings up the Wi-Fi core
63-
*
63+
*
6464
* @return SCL_SUCCESS or Error code.
6565
*/
6666
extern scl_result_t scl_wifi_set_up(void);

0 commit comments

Comments
 (0)