Ok, nachdem ich die Sourcen gefunden hatte hab ich mich selbst ans Werk gemacht.
mit diesem Patch bekomme ich nun auch für alle Statusänderungen Rückmeldungen.
Was noch nicht implementiert ist ist die Überprüfung ob es zu einem Kommunikationsobjekt ein Rückmeldeobjekt gibt.
Gruß Martin
Code:
*** original.c 2012-01-17 22:26:56.000000000 +0100
--- fb_relais_app.c 2012-01-17 22:24:36.866477800 +0100
***************
*** 158,164 ****
// DEBUG_PUTHEX(portValue);
/* send response telegram to inform other devices that port was switched */
! sendTelegram(i,(portValue & j)?1:0, 0x0C);
switchObjects();
}
--- 158,164 ----
// DEBUG_PUTHEX(portValue);
/* send response telegram to inform other devices that port was switched */
! //sendTelegram(i,(portValue & j)?1:0, 0x0C); //CommentKrasserMann
switchObjects();
}
***************
*** 547,557 ****
//** @todo need to check here for respond
// send response telegram to inform other devices that port was switched
! sendTelegram(commObjectNumber, data, 0x0C);
}
switchObjects();
}
!
/**
* Switch the objects to state in portValue and save value to eeprom if necessary.
*
--- 547,558 ----
//** @todo need to check here for respond
// send response telegram to inform other devices that port was switched
! //sendTelegram(commObjectNumber, data, 0x0C); //Comment: KrasserMann
}
switchObjects();
}
!
!
/**
* Switch the objects to state in portValue and save value to eeprom if necessary.
*
***************
*** 561,567 ****
uint16_t initialPortValue;
uint8_t portOperationMode; /**< defines if IO is closer or opener, see address 0x01F2 in eeprom */
uint8_t savedValue;
! uint8_t i;
DEBUG_PUTS("Sw");
DEBUG_NEWLINE();
--- 562,570 ----
uint16_t initialPortValue;
uint8_t portOperationMode; /**< defines if IO is closer or opener, see address 0x01F2 in eeprom */
uint8_t savedValue;
! uint8_t i;
! uint8_t pattern;
!
DEBUG_PUTS("Sw");
DEBUG_NEWLINE();
***************
*** 573,579 ****
/* read saved status and check if it was changed */
savedValue = mem_ReadByte(0x0100);
! if(savedValue != portValue) {
// now check if last status must be saved, we write to eeprom only if necessary
initialPortValue = ((uint16_t)mem_ReadByte(0x01F7) << 8) | ((uint16_t)mem_ReadByte(0x01F6));
for(i=0; i<=7; i++) {
--- 576,596 ----
/* read saved status and check if it was changed */
savedValue = mem_ReadByte(0x0100);
! if(savedValue != portValue) {
!
!
! // R�ckmeldungen Senden ( @todo pruefen ob ein r�ckmeldeobjekt besteht)
! for (i=0;i<8;i++) {
! pattern=1<<i;
! if((portValue&pattern)!=(savedValue&pattern)) {
! sendTelegram(i, (portValue & pattern) ? 1 : 0, 0x0C);
! }
!
! }
!
!
!
!
// now check if last status must be saved, we write to eeprom only if necessary
initialPortValue = ((uint16_t)mem_ReadByte(0x01F7) << 8) | ((uint16_t)mem_ReadByte(0x01F6));
for(i=0; i<=7; i++) {