diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-09-14 10:44:31 -0400 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-09-14 10:44:31 -0400 |
| commit | ecc219fe504f348d5dceb13b0a12d04d1c858781 (patch) | |
| tree | 3e6d79d558e821e3daac90b711275be5c0153015 /shared-bindings/socketpool/Socket.h | |
| parent | f95ad7b27c040e54daeb4c71d6bb6c35844be66e (diff) | |
| parent | 94e261370b4ffc7739d6e3e0ca99db9f36f3027b (diff) | |
Merge remote-tracking branch 'upstream/main' into esp32-displayio-fix
Diffstat (limited to 'shared-bindings/socketpool/Socket.h')
| -rw-r--r-- | shared-bindings/socketpool/Socket.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h new file mode 100644 index 000000000..f0be95c92 --- /dev/null +++ b/shared-bindings/socketpool/Socket.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H + +#include "common-hal/socketpool/Socket.h" + +extern const mp_obj_type_t socketpool_socket_type; + +void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms); +bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, size_t hostlen, mp_int_t port); +mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); +mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len); +void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self); +bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self); +bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self); +mp_uint_t common_hal_socketpool_socket_get_hash(socketpool_socket_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H |
