| Listing 1. Pseudo-code of one of the N ROADM agents. |
| while (True): |
| for every circuit pack: |
| for every port: |
| if port-direction ==“tx”: |
| <read tx power from device port> |
| else if port-direction ==“rx”: |
| <read rx power from device port> |
| <prepare message for the OneM2M> |
| <send message> |
| <sleep(sleeping-time)> |