Skip to content

Commit

Permalink
v2.3.0 - Maintenance release - see Release_Notes.html
Browse files Browse the repository at this point in the history
  • Loading branch information
pradolis committed Nov 15, 2024
1 parent 3bbc912 commit 25a41c8
Show file tree
Hide file tree
Showing 582 changed files with 51,328 additions and 8,827 deletions.
31 changes: 21 additions & 10 deletions Middlewares/ST/PnPLCompManager/Release_Notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,20 @@ <h1 id="purpose">Purpose</h1>
<div class="col-sm-12 col-lg-8">
<h1 id="update-history">Update History</h1>
<div class="collapse">
<input type="checkbox" id="collapse-section8" checked aria-hidden="true"> <label for="collapse-section8" aria-hidden="true"><strong>v2.2.0 / 19-Jul-24</strong></label>
<input type="checkbox" id="collapse-section9" checked aria-hidden="true"> <label for="collapse-section9" aria-hidden="true"><strong>v2.2.1 / 20-Sep-24</strong></label>
<div>
<h2 id="main-changes">Main Changes</h2>
<h3 id="patch-release">Patch release</h3>
<ul>
<li>Fixed null pointer exception check</li>
<li>Added missing “wrong command” management</li>
</ul>
</div>
</div>
<div class="collapse">
<input type="checkbox" id="collapse-section8" checked aria-hidden="true"> <label for="collapse-section8" aria-hidden="true"><strong>v2.2.0 / 19-Jul-24</strong></label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<h3 id="maintenance-release-and-product-update">Maintenance release and product update</h3>
<ul>
<li>Added PnPLCreateLogMessage function to manage log messages (PnPL_Error, PnPL_Warning, PnPL_Info)</li>
Expand All @@ -52,8 +63,8 @@ <h3 id="maintenance-release-and-product-update">Maintenance release and product
<div class="collapse">
<input type="checkbox" id="collapse-section7" aria-hidden="true"> <label for="collapse-section7" aria-hidden="true"><strong>v2.1.2 / 12-Jun-24</strong></label>
<div>
<h2 id="main-changes-1">Main Changes</h2>
<h3 id="patch-release">Patch release</h3>
<h2 id="main-changes-2">Main Changes</h2>
<h3 id="patch-release-1">Patch release</h3>
<ul>
<li>Add multi-threading guard method for PnPL</li>
<li>Add usage of pnpl_malloc</li>
Expand All @@ -64,8 +75,8 @@ <h3 id="patch-release">Patch release</h3>
<div class="collapse">
<input type="checkbox" id="collapse-section6" aria-hidden="true"> <label for="collapse-section6" aria-hidden="true"><strong>v2.1.1 / 12-Apr-24</strong></label>
<div>
<h2 id="main-changes-2">Main Changes</h2>
<h3 id="patch-release-1">Patch release</h3>
<h2 id="main-changes-3">Main Changes</h2>
<h3 id="patch-release-2">Patch release</h3>
<ul>
<li>Fixed comp_name array: must be longer (see PnPLParseCommand)</li>
<li>Renamed PnPL errors defines</li>
Expand All @@ -76,7 +87,7 @@ <h3 id="patch-release-1">Patch release</h3>
<div class="collapse">
<input type="checkbox" id="collapse-section5" aria-hidden="true"> <label for="collapse-section5" aria-hidden="true"><strong>v2.1.0 / 16-Feb-24</strong></label>
<div>
<h2 id="main-changes-3">Main Changes</h2>
<h2 id="main-changes-4">Main Changes</h2>
<h3 id="maintenance-release">Maintenance release</h3>
<ul>
<li>Bug fixed: return PnPL_Error json in case the component is not found</li>
Expand All @@ -89,7 +100,7 @@ <h3 id="maintenance-release">Maintenance release</h3>
<div class="collapse">
<input type="checkbox" id="collapse-section4" aria-hidden="true"> <label for="collapse-section4" aria-hidden="true"><strong>v2.0.0 / 29-Sep-23</strong></label>
<div>
<h2 id="main-changes-4">Main Changes</h2>
<h2 id="main-changes-5">Main Changes</h2>
<h3 id="product-update">Product update</h3>
<ul>
<li><strong>First release of PnPLCompManager as ST Middlewares</strong></li>
Expand All @@ -103,7 +114,7 @@ <h3 id="product-update">Product update</h3>
<div class="collapse">
<input type="checkbox" id="collapse-section3" aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>v1.2.0 / 7-Jul-23</strong></label>
<div>
<h2 id="main-changes-5">Main Changes</h2>
<h2 id="main-changes-6">Main Changes</h2>
<h3 id="maintenance-release-1">Maintenance release</h3>
<ul>
<li>New PnPLSerializeTelemetry to manage both primitive value and Objects Properties</li>
Expand All @@ -114,7 +125,7 @@ <h3 id="maintenance-release-1">Maintenance release</h3>
<div class="collapse">
<input type="checkbox" id="collapse-section2" aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>v1.1.0 / 24-Mar-23</strong></label>
<div>
<h2 id="main-changes-6">Main Changes</h2>
<h2 id="main-changes-7">Main Changes</h2>
<h3 id="maintenance-release-2">Maintenance release</h3>
<ul>
<li>Updated get_presentation PnPL Base command: from “system_info” to “get_presentation”.</li>
Expand All @@ -124,7 +135,7 @@ <h3 id="maintenance-release-2">Maintenance release</h3>
<div class="collapse">
<input type="checkbox" id="collapse-section1" aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>v1.0.0 / 2-Dec-22</strong></label>
<div>
<h2 id="main-changes-7">Main Changes</h2>
<h2 id="main-changes-8">Main Changes</h2>
<h3 id="first-official-release">First official release</h3>
<ul>
<li>First official release</li>
Expand Down
81 changes: 55 additions & 26 deletions Middlewares/ST/PnPLCompManager/Src/PnPLCompManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ void pnpl_free(void *ptr){
*/
void PnPLSetAllocationFunctions(PnPL_Malloc_Function malloc_fun, PnPL_Free_Function free_fun)
{
/* Parson allocation functions */
json_set_allocation_functions(malloc_fun, free_fun);
if(NULL != malloc_fun && NULL != free_fun)
{
/* Parson allocation functions */
json_set_allocation_functions(malloc_fun, free_fun);

prv_pnpl_malloc = malloc_fun;
prv_pnpl_free = free_fun;
prv_pnpl_malloc = malloc_fun;
prv_pnpl_free = free_fun;
}
}


Expand Down Expand Up @@ -188,7 +191,7 @@ uint8_t PnPL_SetLockUnlockCallbacks(PnPLockCallback lock_callback, PnPLUnlockCal
{
uint8_t pnpn_RetVal = PNPL_NULL_PTR_ARG_CODE;

if(NULL != lock_callback || NULL != unlock_callback)
if(NULL != lock_callback && NULL != unlock_callback)
{
pnpl_lock_fp = lock_callback;
pnpl_unlock_fp = unlock_callback;
Expand Down Expand Up @@ -809,16 +812,24 @@ uint8_t PnPLParseCommand(char *commandString, PnPLCommand_t *command)
#if defined(PNPL_RESPONSES) || defined(PNPL_BLE_RESPONSES)
char *cmd_response = 0;
uint32_t size = 0;
(void)IPnPLCommandExecuteFunction(p_obj, commandString, &cmd_response, &size, 0);
// /* CMD Response */
command->comm_type = PNPL_CMD_COMMAND;
// command->response = (char*)pnpl_malloc(size);
// if (command->response != NULL)
// {
// strcpy(command->response, cmd_response);
// pnpl_free(cmd_response);
// }
// /* CMD Response*/
ret = IPnPLCommandExecuteFunction(p_obj, commandString, &cmd_response, &size, 0);
/* CMD Response */
if(ret == PNPL_NO_ERROR_CODE)
{
command->comm_type = PNPL_CMD_COMMAND;
}
else
{
command->comm_type = PNPL_CMD_ERROR;
cmd_response = "Invalid cmd";
command->response = (char*)pnpl_malloc(strlen(cmd_response)+1);
if (command->response != NULL)
{
strcpy(command->response, cmd_response);
pnpl_free(cmd_response);
}
ret = PNPL_BASE_ERROR_CODE;
}
#else
(void)IPnPLCommandExecuteFunction(p_obj, commandString);
#endif
Expand Down Expand Up @@ -922,7 +933,9 @@ uint8_t PnPLSerializeResponse(PnPLCommand_t *command, char **SerializedJSON, uin
}
if (comp_found == 0u)
{
PnPLCreateLogMessage(SerializedJSON, size, "", PNPL_LOG_ERROR);
char local_error[100];
(void) sprintf(local_error, "get_status %s property doesn't exist", command->comp_name);
PnPLCreateLogMessage(SerializedJSON, size, local_error, PNPL_LOG_ERROR);
ret = PNPL_BASE_ERROR_CODE;
}
}
Expand All @@ -944,7 +957,15 @@ uint8_t PnPLSerializeResponse(PnPLCommand_t *command, char **SerializedJSON, uin
#endif
else if (command->comm_type == PNPL_CMD_ERROR)
{
PnPLCreateLogMessage(SerializedJSON, size, command->comp_name, PNPL_LOG_ERROR);
if (command->response != NULL)
{
PnPLCreateLogMessage(SerializedJSON, size, command->response, PNPL_LOG_ERROR);
pnpl_free(command->response);
}
else
{
PnPLCreateLogMessage(SerializedJSON, size, command->comp_name, PNPL_LOG_ERROR);
}
}
else
{
Expand Down Expand Up @@ -1542,15 +1563,23 @@ static uint8_t _PnPLParseCommand(char *commandString, PnPLCommand_t *command)
char *cmd_response = 0;
uint32_t size = 0;
(void)IPnPLCommandExecuteFunction(p_obj, commandString, &cmd_response, &size, 0);
// /* CMD Response */
command->comm_type = PNPL_CMD_COMMAND;
// command->response = (char*)pnpl_malloc(size);
// if (command->response != NULL)
// {
// strcpy(command->response, cmd_response);
// pnpl_free(cmd_response);
// }
// /* CMD Response*/
/* CMD Response */
if(ret == PNPL_NO_ERROR_CODE)
{
command->comm_type = PNPL_CMD_COMMAND;
}
else
{
command->comm_type = PNPL_CMD_ERROR;
cmd_response = "Invalid cmd";
command->response = (char*)pnpl_malloc(strlen(cmd_response)+1);
if (command->response != NULL)
{
strcpy(command->response, cmd_response);
pnpl_free(cmd_response);
}
ret = PNPL_BASE_ERROR_CODE;
}
#else
(void)IPnPLCommandExecuteFunction(p_obj, commandString);
#endif
Expand Down
Loading

0 comments on commit 25a41c8

Please sign in to comment.