func MH_send_new_order(to_elev int64, order [2]int, sendOrderCh chan UdpMessage) { var msg UdpMessage msg.Order_ID = to_elev msg.Order = order Elev_control.Fsm_addOrder(order, to_elev) sendOrderCh <- msg }
func MH_HandleIncomingMsg(msgFromNetwork chan UdpMessage, updateElevsCh chan Elev_control.Elevator, receiveBtnCallCh chan [2]int, receiveAllBtnCallsCh chan [4][2]bool) { var msg UdpMessage for { msg = <-msgFromNetwork switch msg.Order_ID { case statusMsg: updateElevsCh <- msg.Data break case btnCallMsg: receiveBtnCallCh <- msg.Order case allBtnCallsMsg: receiveAllBtnCallsCh <- msg.Btn_calls default: Elev_control.Fsm_addOrder(msg.Order, msg.Order_ID) } } }