Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
74589cbe
Commit
74589cbe
authored
10 years ago
by
danicampora
Browse files
Options
Downloads
Patches
Plain Diff
cc3200: Move code that disables/enables servers to wlan_sl_enable().
parent
5330d899
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
cc3200/mods/modwlan.c
+12
-13
12 additions, 13 deletions
cc3200/mods/modwlan.c
cc3200/mptask.c
+1
-1
1 addition, 1 deletion
cc3200/mptask.c
cc3200/serverstask.h
+1
-0
1 addition, 0 deletions
cc3200/serverstask.h
with
14 additions
and
14 deletions
cc3200/mods/modwlan.c
+
12
−
13
View file @
74589cbe
...
@@ -362,6 +362,12 @@ modwlan_Status_t wlan_sl_enable (SlWlanMode_t mode, const char *ssid, uint8_t ss
...
@@ -362,6 +362,12 @@ modwlan_Status_t wlan_sl_enable (SlWlanMode_t mode, const char *ssid, uint8_t ss
const
char
*
key
,
uint8_t
key_len
,
uint8_t
channel
)
{
const
char
*
key
,
uint8_t
key_len
,
uint8_t
channel
)
{
if
(
mode
==
ROLE_STA
||
mode
==
ROLE_AP
||
mode
==
ROLE_P2P
)
{
if
(
mode
==
ROLE_STA
||
mode
==
ROLE_AP
||
mode
==
ROLE_P2P
)
{
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
// Stop all other processes using the wlan engine
if
((
wlan_obj
.
servers_enabled
=
servers_are_enabled
()))
{
wlan_stop_servers
();
}
#endif
if
(
wlan_obj
.
mode
<
0
)
{
if
(
wlan_obj
.
mode
<
0
)
{
wlan_obj
.
mode
=
sl_Start
(
0
,
0
,
0
);
wlan_obj
.
mode
=
sl_Start
(
0
,
0
,
0
);
sl_LockObjUnlock
(
&
wlan_LockObj
);
sl_LockObjUnlock
(
&
wlan_LockObj
);
...
@@ -486,6 +492,12 @@ modwlan_Status_t wlan_sl_enable (SlWlanMode_t mode, const char *ssid, uint8_t ss
...
@@ -486,6 +492,12 @@ modwlan_Status_t wlan_sl_enable (SlWlanMode_t mode, const char *ssid, uint8_t ss
wlan_reenable
(
mode
);
wlan_reenable
(
mode
);
}
}
}
}
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
// Start the servers again
if
(
wlan_obj
.
servers_enabled
)
{
servers_enable
();
}
#endif
return
MODWLAN_OK
;
return
MODWLAN_OK
;
}
}
return
MODWLAN_ERROR_INVALID_PARAMS
;
return
MODWLAN_ERROR_INVALID_PARAMS
;
...
@@ -674,13 +686,6 @@ STATIC mp_obj_t wlan_make_new (mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k
...
@@ -674,13 +686,6 @@ STATIC mp_obj_t wlan_make_new (mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k
if
(
n_args
>
0
)
{
if
(
n_args
>
0
)
{
// Get the mode
// Get the mode
SlWlanMode_t
mode
=
mp_obj_get_int
(
args
[
0
]);
SlWlanMode_t
mode
=
mp_obj_get_int
(
args
[
0
]);
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
// Stop all other processes using the wlan engine
if
((
wlan_obj
.
servers_enabled
=
servers_are_enabled
()))
{
wlan_stop_servers
();
}
#endif
if
(
mode
==
ROLE_AP
)
{
if
(
mode
==
ROLE_AP
)
{
// start the peripheral
// start the peripheral
mp_map_t
kw_args
;
mp_map_t
kw_args
;
...
@@ -696,12 +701,6 @@ STATIC mp_obj_t wlan_make_new (mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k
...
@@ -696,12 +701,6 @@ STATIC mp_obj_t wlan_make_new (mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k
else
{
else
{
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_TypeError
,
mpexception_num_type_invalid_arguments
));
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_TypeError
,
mpexception_num_type_invalid_arguments
));
}
}
#if (MICROPY_PORT_HAS_TELNET || MICROPY_PORT_HAS_FTP)
// Start the servers again
if
(
wlan_obj
.
servers_enabled
)
{
servers_enable
();
}
#endif
}
else
if
(
wlan_obj
.
mode
<
0
)
{
}
else
if
(
wlan_obj
.
mode
<
0
)
{
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_TypeError
,
mpexception_num_type_invalid_arguments
));
nlr_raise
(
mp_obj_new_exception_msg
(
&
mp_type_TypeError
,
mpexception_num_type_invalid_arguments
));
}
}
...
...
This diff is collapsed.
Click to expand it.
cc3200/mptask.c
+
1
−
1
View file @
74589cbe
...
@@ -319,7 +319,7 @@ STATIC void main_init_sflash_filesystem (void) {
...
@@ -319,7 +319,7 @@ STATIC void main_init_sflash_filesystem (void) {
STATIC
void
main_enter_ap_mode
(
void
)
{
STATIC
void
main_enter_ap_mode
(
void
)
{
// Enable simplelink in low power mode
// Enable simplelink in low power mode
wlan_sl_enable
(
ROLE_AP
,
SERVERS_DEF_AP_SSID
,
strlen
(
SERVERS_DEF_AP_SSID
),
S
L_SEC_TYPE_WPA_WPA2
,
wlan_sl_enable
(
ROLE_AP
,
SERVERS_DEF_AP_SSID
,
strlen
(
SERVERS_DEF_AP_SSID
),
S
ERVERS_DEF_AP_SECURITY
,
SERVERS_DEF_AP_KEY
,
strlen
(
SERVERS_DEF_AP_KEY
),
SERVERS_DEF_AP_CHANNEL
);
SERVERS_DEF_AP_KEY
,
strlen
(
SERVERS_DEF_AP_KEY
),
SERVERS_DEF_AP_CHANNEL
);
wlan_set_pm_policy
(
SL_NORMAL_POLICY
);
wlan_set_pm_policy
(
SL_NORMAL_POLICY
);
}
}
...
...
This diff is collapsed.
Click to expand it.
cc3200/serverstask.h
+
1
−
0
View file @
74589cbe
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#define SERVERS_PASS_LEN_MAX 16
#define SERVERS_PASS_LEN_MAX 16
#define SERVERS_DEF_AP_SSID "micropy-wlan"
#define SERVERS_DEF_AP_SSID "micropy-wlan"
#define SERVERS_DEF_AP_SECURITY SL_SEC_TYPE_WPA_WPA2
#define SERVERS_DEF_AP_KEY "micropython"
#define SERVERS_DEF_AP_KEY "micropython"
#define SERVERS_DEF_AP_CHANNEL 6
#define SERVERS_DEF_AP_CHANNEL 6
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment