-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform: rework architecture and options, introduce weaks
- Loading branch information
1 parent
1161d0d
commit 4ba3cc5
Showing
29 changed files
with
994 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @file mender-log.c | ||
* @brief Mender logging interface for weak platform | ||
* | ||
* MIT License | ||
* | ||
* Copyright (c) 2022-2023 joelguittet and mender-mcu-client contributors | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include "mender-log.h" | ||
|
||
__attribute__((weak)) mender_err_t | ||
mender_log_init(void) { | ||
|
||
/* Nothing to do */ | ||
return MENDER_OK; | ||
} | ||
|
||
__attribute__((weak)) mender_err_t | ||
mender_log_print(uint8_t level, const char *filename, const char *function, int line, char *format, ...) { | ||
|
||
(void)level; | ||
(void)filename; | ||
(void)function; | ||
(void)line; | ||
(void)format; | ||
|
||
/* Nothing to do */ | ||
return MENDER_OK; | ||
} | ||
|
||
__attribute__((weak)) mender_err_t | ||
mender_log_exit(void) { | ||
|
||
/* Nothing to do */ | ||
return MENDER_OK; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* @file mender-http.c | ||
* @brief Mender HTTP interface for weak platform | ||
* | ||
* MIT License | ||
* | ||
* Copyright (c) 2022-2023 joelguittet and mender-mcu-client contributors | ||
* | ||
* 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. | ||
*/ | ||
|
||
#include "mender-http.h" | ||
|
||
__attribute__((weak)) mender_err_t | ||
mender_http_init(mender_http_config_t *config) { | ||
|
||
(void)config; | ||
|
||
/* Nothing to do */ | ||
return MENDER_OK; | ||
} | ||
|
||
__attribute__((weak)) mender_err_t | ||
mender_http_perform(char * jwt, | ||
char * path, | ||
mender_http_method_t method, | ||
char * payload, | ||
char * signature, | ||
mender_err_t (*callback)(mender_http_client_event_t, void *, size_t, void *), | ||
void *params, | ||
int * status) { | ||
|
||
(void)jwt; | ||
(void)path; | ||
(void)method; | ||
(void)payload; | ||
(void)signature; | ||
(void)callback; | ||
(void)params; | ||
(void)status; | ||
|
||
/* Nothing to do */ | ||
return MENDER_NOT_IMPLEMENTED; | ||
} | ||
|
||
__attribute__((weak)) mender_err_t | ||
mender_http_exit(void) { | ||
|
||
/* Nothing to do */ | ||
return MENDER_OK; | ||
} |
Oops, something went wrong.