-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(modem): One step closer to perfect forwarding
- Loading branch information
1 parent
9b334e7
commit a738300
Showing
10 changed files
with
76 additions
and
76 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
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
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
64 changes: 64 additions & 0 deletions
64
components/esp_modem/generate/include/esp_modem_command_declare_helper.inc
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,64 @@ | ||
// | ||
//#define INT_IN(name) int name | ||
//#ifdef __cplusplus | ||
//#define STRING_IN(name) const std::string& name | ||
//#define STRING_OUT(name) std::string& name | ||
//#define BOOL_IN(name) const bool name | ||
//#define BOOL_OUT(name) bool& name | ||
//#define INT_OUT(name) int& name | ||
//#define INTEGER_LIST_IN(name) const int* name | ||
//#define STRUCT_OUT(struct_name, name) struct_name& name | ||
//#else | ||
//#define STRING_IN(name) const char* name | ||
//#define STRING_OUT(name) char* name | ||
//#define BOOL_IN(name) const bool name | ||
//#define BOOL_OUT(name) bool* name | ||
//#define INT_OUT(name) int* name | ||
//#define INTEGER_LIST_IN(name) const int* name | ||
//#define STRUCT_OUT(struct_name, name) esp_modem_ ## struct_name ## _t* name | ||
//#endif | ||
// | ||
//#define FORWARD_INT_IN(name) name | ||
//#define FORWARD_STRING_IN(name) name | ||
//#define FORWARD_STRING_OUT(name) name | ||
//#define FORWARD_BOOL_IN(name) name | ||
//#define FORWARD_BOOL_OUT(name) name | ||
//#define FORWARD_INT_OUT(name) name | ||
//#define FORWARD_INTEGER_LIST_IN(name) name | ||
//#define FORWARD_STRUCT_OUT(struct_name, name) name | ||
|
||
// Utility to count arguments (works for up to two parameters here) | ||
#define ESP_MODEM_GET_MACRO(_0, _1, _2, _3, _4, _5, _6, ESP_MODEM_MACRO_NAME, ...) ESP_MODEM_MACRO_NAME | ||
#define ESP_MODEM_COMMAND_PARAMS(...) ESP_MODEM_GET_MACRO(_0, ##__VA_ARGS__, ESP_MODEM_HELPER6, ESP_MODEM_HELPER5, ESP_MODEM_HELPER4, ESP_MODEM_HELPER3, ESP_MODEM_HELPER2, ESP_MODEM_HELPER1, ESP_MODEM_HELPER0)(PARAM_, ESP_MODEM_NO_COMMA, ESP_MODEM_NO_COMMA, ##__VA_ARGS__) | ||
#define ESP_MODEM_COMMAND_PARAMS_AFTER(...) ESP_MODEM_GET_MACRO(_0, ##__VA_ARGS__, ESP_MODEM_HELPER6, ESP_MODEM_HELPER5, ESP_MODEM_HELPER4, ESP_MODEM_HELPER3, ESP_MODEM_HELPER2, ESP_MODEM_HELPER1, ESP_MODEM_HELPER0)(PARAM_, ESP_MODEM_COMMA, ESP_MODEM_NO_COMMA, ##__VA_ARGS__) | ||
#define ESP_MODEM_COMMAND_FORWARD(...) ESP_MODEM_GET_MACRO(_0, ##__VA_ARGS__, ESP_MODEM_HELPER6, ESP_MODEM_HELPER5, ESP_MODEM_HELPER4, ESP_MODEM_HELPER3, ESP_MODEM_HELPER2, ESP_MODEM_HELPER1, ESP_MODEM_HELPER0)(FORWARD_, ESP_MODEM_NO_COMMA, ESP_MODEM_NO_COMMA, ##__VA_ARGS__) | ||
#define ESP_MODEM_COMMAND_FORWARD_AFTER(...) ESP_MODEM_GET_MACRO(_0, ##__VA_ARGS__, ESP_MODEM_HELPER6, ESP_MODEM_HELPER5, ESP_MODEM_HELPER4, ESP_MODEM_HELPER3, ESP_MODEM_HELPER2, ESP_MODEM_HELPER1, ESP_MODEM_HELPER0)(FORWARD_, ESP_MODEM_COMMA, ESP_MODEM_NO_COMMA, ##__VA_ARGS__) | ||
|
||
#define PARAM_STR_OUT(name) std::string& name | ||
#define FORWARD_STR_OUT(name) name | ||
#define PARAM_STR_IN(name) const std::string& name | ||
#define FORWARD_STR_IN(name) name | ||
#define PARAM_INT_OUT(name) int& name | ||
#define FORWARD_INT_OUT(name) name | ||
#define PARAM_INT_IN(name) int name | ||
#define FORWARD_INT_IN(name) name | ||
#define ESP_MODEM_COMMA , | ||
#define ESP_MODEM_NO_COMMA | ||
|
||
#define ESP_MODEM_HELPER_EVAL(x) x | ||
#define ESP_MODEM_HELPER_GENERIC(a, b) ESP_MODEM_HELPER_EVAL(a ## b) | ||
#define ESP_MODEM_HELPER0(prefix, lead_comma, trail_comma) | ||
#define ESP_MODEM_HELPER1(prefix, lead_comma, trail_comma, p1) lead_comma ESP_MODEM_HELPER_GENERIC(prefix, p1) trail_comma | ||
#define ESP_MODEM_HELPER2(prefix, lead_comma, trail_comma, p1, p2) lead_comma ESP_MODEM_HELPER_GENERIC(prefix, p1), ESP_MODEM_HELPER_GENERIC(prefix, p2) trail_comma | ||
#define ESP_MODEM_HELPER3(prefix, lead_comma, trail_comma, p1, p2, p3) lead_comma ESP_MODEM_HELPER_GENERIC(prefix, p1), ESP_MODEM_HELPER_GENERIC(prefix, p2), ESP_MODEM_HELPER_GENERIC(prefix, p3) trail_comma | ||
#define ESP_MODEM_HELPER4(prefix, lead_comma, trail_comma, p1, p2, p3, p4) lead_comma \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p1), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p2), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p3), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p4) trail_comma | ||
#define ESP_MODEM_HELPER5(prefix, lead_comma, trail_comma, p1, p2, p3, p4, p5) lead_comma \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p1), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p2), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p3), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p4), \ | ||
ESP_MODEM_HELPER_GENERIC(prefix, p5) trail_comma |
28 changes: 0 additions & 28 deletions
28
components/esp_modem/include/generate/esp_modem_command_declare_helper.inc
This file was deleted.
Oops, something went wrong.
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