created pong message.
This commit is contained in:
@@ -180,11 +180,10 @@ appNetworkHandlePingRequest:
|
|||||||
brcc appNetworkHandlePingRequest_end ; jmp on error
|
brcc appNetworkHandlePingRequest_end ; jmp on error
|
||||||
push r16 ; buffer num
|
push r16 ; buffer num
|
||||||
mov r16, r17 ; DEST addr
|
mov r16, r17 ; DEST addr
|
||||||
ldi r18, NETMSG_CMD_PONG ; msg type
|
|
||||||
adiw xh:xl, 1
|
adiw xh:xl, 1
|
||||||
ldi yl, LOW(netInterfaceData)
|
ldi yl, LOW(netInterfaceData)
|
||||||
ldi yh, HIGH(netInterfaceData)
|
ldi yh, HIGH(netInterfaceData)
|
||||||
rcall NETMSG_SimpleMsgWrite ; (R16, R17, R18, R19, R20, X)
|
rcall NETMSG_Pong_Write ; (R16, R17, R18, R19, R20, X)
|
||||||
sbiw xh:xl, 1
|
sbiw xh:xl, 1
|
||||||
pop r16 ; buffer num
|
pop r16 ; buffer num
|
||||||
rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X)
|
rcall NET_Interface_AddOrReleaseOutMsg ; (R16, R17, R18, X)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
debug-w.asm
|
debug-w.asm
|
||||||
device-w.asm
|
device-w.asm
|
||||||
memstats-w.asm
|
memstats-w.asm
|
||||||
|
pong-w.asm
|
||||||
reboot-d.asm
|
reboot-d.asm
|
||||||
reboot-r.asm
|
reboot-r.asm
|
||||||
recvstats-w.asm
|
recvstats-w.asm
|
||||||
|
|||||||
37
avr/modules/network/msg/pong-w.asm
Normal file
37
avr/modules/network/msg/pong-w.asm
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
; ***************************************************************************
|
||||||
|
; copyright : (C) 2025 by Martin Preuss
|
||||||
|
; email : martin@libchipcard.de
|
||||||
|
;
|
||||||
|
; ***************************************************************************
|
||||||
|
; * This file is part of the project "AqHome". *
|
||||||
|
; * Please see toplevel file COPYING of that project for license details. *
|
||||||
|
; ***************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine NETMSG_Pong_Write @global
|
||||||
|
;
|
||||||
|
; @param R16 dest addr
|
||||||
|
; @param Y pointer to device to write msg for and to
|
||||||
|
; @param X pointer to buffer to write to
|
||||||
|
; @clobbers R16 (R17, R18, R19, R20, R21, Z)
|
||||||
|
|
||||||
|
NETMSG_Pong_Write:
|
||||||
|
st X+, r16 ; dest address
|
||||||
|
ldi r16, 6 ; msg code+src address+4 payload bytes
|
||||||
|
st X+, r16 ; msg len
|
||||||
|
ldi r16, NETMSG_CMD_PONG
|
||||||
|
st X+, r16 ; msg code
|
||||||
|
ldd r16, Y+NET_IFACE_OFFS_ADDRESS
|
||||||
|
st X+, r16 ; src address
|
||||||
|
rcall NETMSG_Common_AddUidToBuffer ; (R16, R18, R19, R20, R21)
|
||||||
|
|
||||||
|
sbiw xh:xl, 8 ; go back to beginning of message (1 byte dst addr, 1 byte length, 6 bytes payload)
|
||||||
|
rcall NETMSG_CalcAndAddChecksumByte ; (R16, R17, R18, R19, R20, X)
|
||||||
|
sbiw xh:xl, 9 ; go back to beginning of message (1 byte dst addr, 1 byte length, 6 bytes payload, 1 byte crc)
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user