codde_protocol 0.1.6

Multi Communication protocol in heart of the C.O.D.D.E. Pi framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

import codde_protocol as cp
import time
server = cp.CoddePiServer.use_socket('localhost:12345')

@cp.event(server)
def action_1(*args):
    widget: cp.ToggleButton = args[0]
    print("value received : ", widget.value)
    server.callback(1, cp.ServerStatus.Idle, cp.ConfirmResult(True)) 

if __name__ == "__main__":
    print('open server...')
    server.open()
    # server.callback(1, cp.ServerStatus.Idle, cp.ConfirmResult(True)) 
    server.serve()
    time.sleep(2)
    server.close()