(transport)
| 97 | |
| 98 | ## Run client on specified transport layer |
| 99 | def runClient(transport): |
| 100 | # create matrix multiply eRPC service |
| 101 | clientManager = erpc.client.ClientManager(transport, erpc.basic_codec.BasicCodec) |
| 102 | client = erpc_matrix_multiply.client.MatrixMultiplyServiceClient(clientManager) |
| 103 | |
| 104 | while True: |
| 105 | # create matrices with random values |
| 106 | matrix1 = fillMatrix(matrix_size, MAX_VALUE) |
| 107 | matrix2 = fillMatrix(matrix_size, MAX_VALUE) |
| 108 | |
| 109 | # print matrices to the console |
| 110 | print('\r\nMatrix #1\r\n=========') |
| 111 | printMatrix(matrix1) |
| 112 | |
| 113 | print('\r\nMatrix #2\r\n=========') |
| 114 | printMatrix(matrix2) |
| 115 | |
| 116 | # create result matrix as eRPC reference object |
| 117 | resultMatrix = erpc.Reference() |
| 118 | |
| 119 | # send request to the server |
| 120 | print('\r\neRPC request is sent to the server') |
| 121 | client.erpcMatrixMultiply(matrix1, matrix2, resultMatrix) |
| 122 | |
| 123 | # print result matrix's value |
| 124 | print('\r\nResult matrix\r\n=============') |
| 125 | printMatrix(resultMatrix.value) |
| 126 | |
| 127 | # wait for key press |
| 128 | print('\r\nPress Enter to initiate the next matrix multiplication') |
| 129 | sys.stdout.flush() |
| 130 | input_fn() |
| 131 | |
| 132 | ############################################################################### |
| 133 | # Main |
no test coverage detected