Skip to content

Commit

Permalink
Merge pull request #3 from vChavezB/alpha
Browse files Browse the repository at this point in the history
Fix port argument for logging , enabled logging again for
  • Loading branch information
vChavezB authored May 29, 2024
2 parents a18f2c9 + a46c604 commit 0e359d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions samples/read_pd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ Where:
## Expected Output

```python
*** Booting Zephyr OS build v3.6.0-3220-g69fa7dc2686e ***
[00:00:00.366,668] <inf> read_pd: Zephyr IO-Link Master PDIn Sample Application
[00:00:00.474,731] <inf> read_pd: Port [2]: Status changed
[00:00:00.503,967] <inf> iol_master: Port [1] status changed to Operate
[00:00:00.503,967] <inf> read_pd: Port [1]: Status changed
[00:00:01.026,672] <inf> read_pd: Port [1] PDIn 0000
[00:00:01.062,683] <inf> iol_master: Port [2] status changed to Operate
[00:00:01.062,713] <inf> read_pd: Port [2]: Status changed
[00:00:01.067,932] <inf> read_pd: Port [2] PDIn 0000
[00:00:02.059,936] <inf> read_pd: Port [1] PDIn 0000
*** Booting Zephyr OS build ***
[00:00:00.362,121] <inf> read_pd: Zephyr IO-Link Master PDIn Sample Application
[00:00:00.499,084] <inf> read_pd: Port [1] Operate: VID 123 DID 123
[00:00:01.021,820] <inf> read_pd: Port [1] PDIn 0000
[00:00:01.057,464] <inf> read_pd: Port [2] Operate: VID 123 DID 123
[00:00:01.062,683] <inf> read_pd: Port [2] PDIn 0000
[00:00:01.269,561] <inf> read_pd: Port [2] Event type: warning mode: appears code 1234
[00:00:02.055,084] <inf> read_pd: Port [1] PDIn 0000
[00:00:02.096,038] <inf> read_pd: Port [2] PDIn 10f0
```
4 changes: 2 additions & 2 deletions samples/read_pd/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ void iolm_port_event_cb(uint8_t port, enum iolm_port_evt evt, void *data, void *
for (size_t i = 0; i < pd_data->len; i++) {
sprintf(pdin_data + (i * 2), "%02x", pd_data->data[i]);
}
//LOG_INF("Port [%d] PDIn %s", port, pdin_data);
LOG_INF("Port [%d] PDIn %s", port, pdin_data);
last_print[port_idx] = current_time;
break;
}
case IOLM_PORT_STATUS:
{
const arg_block_portstatuslist_t * status_list = (arg_block_portstatuslist_t *)data;
if (status_list->port_status_info == IOLINK_PORT_STATUS_INFO_OP) {
LOG_INF("Port [%d] Operate: VID %x DID %x", status_list->vendorid,status_list->deviceid);
LOG_INF("Port [%d] Operate: VID %x DID %x", port,status_list->vendorid,status_list->deviceid);
}
if (status_list->port_status_info == IOLINK_PORT_STATUS_INFO_NO_DEV) {
LOG_WRN("Port [%d] COM Lost", port);
Expand Down

0 comments on commit 0e359d1

Please sign in to comment.