Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
3438e800
Commit
3438e800
authored
May 14, 2022
by
iabdalkader
Committed by
Damien George
May 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extmod/modusocket: Add support for socket events callback.
Add support for the special sockopt 20.
parent
fc1f8761
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
extmod/modusocket.c
extmod/modusocket.c
+6
-0
No files found.
extmod/modusocket.c
View file @
3438e800
...
...
@@ -331,6 +331,12 @@ STATIC mp_obj_t socket_setsockopt(size_t n_args, const mp_obj_t *args) {
val
=
mp_obj_get_int_truncated
(
args
[
3
]);
optval
=
&
val
;
optlen
=
sizeof
(
val
);
}
else
if
(
opt
==
20
&&
args
[
3
]
==
mp_const_none
)
{
optval
=
MP_OBJ_NULL
;
optlen
=
0
;
}
else
if
(
opt
==
20
&&
mp_obj_is_callable
(
args
[
3
]))
{
optval
=
args
[
3
];
optlen
=
sizeof
(
optval
);
}
else
{
mp_buffer_info_t
bufinfo
;
mp_get_buffer_raise
(
args
[
3
],
&
bufinfo
,
MP_BUFFER_READ
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment