Skip to content

Commit

Permalink
fixed Notify once more
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Mazurov committed Jun 6, 2013
1 parent 77014da commit ae85f29
Show file tree
Hide file tree
Showing 29 changed files with 213 additions and 212 deletions.
4 changes: 2 additions & 2 deletions examples/Canon_EOS/EOSBulb/EOSBulb.pde
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
if (stateConnected == stConnected || stateConnected == stInitial)
{
stateConnected = stDisconnected;
Notify(PSTR("Camera disconnected\r\n"));
Notify(PSTR("Camera disconnected\r\n"),0x80);
}
}

Expand All @@ -46,7 +46,7 @@ void CamStateHandlers::OnDeviceInitializedState(PTP *ptp)
if (stateConnected == stDisconnected || stateConnected == stInitial)
{
stateConnected = stConnected;
Notify(PSTR("Camera connected\r\n"));
Notify(PSTR("Camera connected\r\n"),0x80);

uint16_t rc = ((CanonEOS*)ptp)->SetProperty(EOS_DPC_ShutterSpeed,SHUTTER_SPEED_BULB);

Expand Down
16 changes: 8 additions & 8 deletions examples/Canon_EOS/EOSDualCapture/EOSDualCapture.pde
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ void EOSCamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
if (stateConnected)
{
stateConnected = false;
Notify(PSTR("Camera at: "));
Notify(PSTR("Camera at: "),0x80);
Serial.print(ptp->GetAddress(),HEX);
Notify(PSTR(" disconnected\r\n"));
Notify(PSTR(" disconnected\r\n"),0x80);
}
}

Expand All @@ -57,9 +57,9 @@ void PTPCamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
if (stateConnected)
{
stateConnected = false;
Notify(PSTR("Camera at: "));
Notify(PSTR("Camera at: "),0x80);
Serial.print(ptp->GetAddress(),HEX);
Notify(PSTR(" disconnected\r\n"));
Notify(PSTR(" disconnected\r\n"),0x80);
}
}

Expand All @@ -70,9 +70,9 @@ void EOSCamStateHandlers::OnDeviceInitializedState(PTP *ptp)
if (!stateConnected)
{
stateConnected = true;
Notify(PSTR("Camera at: "));
Notify(PSTR("Camera at: "),0x80);
Serial.print(ptp->GetAddress(),HEX);
Notify(PSTR(" connected\r\n"));
Notify(PSTR(" connected\r\n"),0x80);
}

uint32_t time_now = millis();
Expand All @@ -95,9 +95,9 @@ void PTPCamStateHandlers::OnDeviceInitializedState(PTP *ptp)
if (!stateConnected)
{
stateConnected = true;
Notify(PSTR("Camera at: "));
Notify(PSTR("Camera at: "),0x80);
Serial.print(ptp->GetAddress(),HEX);
Notify(PSTR(" connected\r\n"));
Notify(PSTR(" connected\r\n"),0x80);
}

uint32_t time_now = millis();
Expand Down
4 changes: 2 additions & 2 deletions examples/Canon_EOS/EOSEventLab/EOSEventLab.pde
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
{
((CanonEos*)ptp)->bPollEnabled = false;
stateConnected = stDisconnected;
Notify(PSTR("\r\nDevice disconnected.\r\n"));
Notify(PSTR("\r\nDevice disconnected.\r\n"),0x80);
}
}

Expand All @@ -84,7 +84,7 @@ void CamStateHandlers::OnDeviceInitializedState(PTP *ptp)
if (stateConnected == stDisconnected || stateConnected == stInitial)
{
stateConnected = stConnected;
Notify(PSTR("\r\nDevice connected.\r\n"));
Notify(PSTR("\r\nDevice connected.\r\n"),0x80);
((CanonEos*)ptp)->bPollEnabled = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Canon_EOS/EOSFocus/EOSFocus.pde
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
if (stateConnected == stConnected || stateConnected == stInitial)
{
stateConnected = stDisconnected;
Notify(PSTR("Camera disconnected.\r\n"));
Notify(PSTR("Camera disconnected.\r\n"),0x80);
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/Canon_EOS/EOSHDRCapture/EOSHDRCapture.pde
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
if (stateConnected == stConnected || stateConnected == stInitial)
{
stateConnected = stDisconnected;
Notify(PSTR("Camera disconnected\r\n"));
Notify(PSTR("Camera disconnected\r\n"),0x80);
}
}

Expand All @@ -52,7 +52,7 @@ void CamStateHandlers::OnDeviceInitializedState(PTP *ptp)
{
stateConnected = stConnected;

Notify(PSTR("Camera connected\r\n"));
Notify(PSTR("Camera connected\r\n"),0x80);

SetEvt setEvt;
setEvt.sig = RUN_SIG;
Expand Down
30 changes: 15 additions & 15 deletions examples/Canon_EOS/EOSRemote/EOSConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ const char* menuUpDown[] = {"<<", ">>"};

void EOSConsole::ShowParams()
{
Notify(PSTR("\r\nMode:"));
Notify((char*)FindTitle<VT_MODE, VT_MODE_TEXT_LEN>(VT_MODE_COUNT, ModeTitles, dpMode));
Notify(PSTR("\r\nF:"));
Notify((char*)FindTitle<VT_APERTURE, VT_APT_TEXT_LEN>(VT_APT_COUNT, ApertureTitles, dpAperture));
Notify(PSTR("\r\nT:"));
Notify((char*)FindTitle<VT_SHSPEED, VT_SHSPEED_TEXT_LEN>(VT_SHSPEED_COUNT, ShutterSpeedTitles, dpShutterSpeed));
Notify(PSTR("\r\nWB:"));
Notify((char*)FindTitle<VT_WB, VT_WB_TEXT_LEN>(VT_WB_COUNT, WbTitles, dpWb));
Notify(PSTR("\r\nPict Style:"));
Notify((char*)FindTitle<VT_PSTYLE, VT_PSTYLE_TEXT_LEN>(VT_PSTYLE_COUNT, PStyleTitles, dpPStyle));
Notify(PSTR("\r\nISO:"));
Notify((char*)FindTitle<VT_ISO, VT_ISO_TEXT_LEN>(VT_ISO_COUNT, IsoTitles, dpIso));
Notify(PSTR("\r\nExp Comp:"));
Notify((char*)FindTitle<VT_EXPCOMP, VT_EXPCOMP_TEXT_LEN>(VT_EXPCOMP_COUNT, ExpCompTitles, dpExpComp));
Notify(PSTR("\r\n"));
Notify(PSTR("\r\nMode:"),0x80);
Notify((char*)FindTitle<VT_MODE, VT_MODE_TEXT_LEN>(VT_MODE_COUNT, ModeTitles, dpMode),0x80);
Notify(PSTR("\r\nF:"),0x80);
Notify((char*)FindTitle<VT_APERTURE, VT_APT_TEXT_LEN>(VT_APT_COUNT, ApertureTitles, dpAperture),0x80);
Notify(PSTR("\r\nT:"),0x80);
Notify((char*)FindTitle<VT_SHSPEED, VT_SHSPEED_TEXT_LEN>(VT_SHSPEED_COUNT, ShutterSpeedTitles, dpShutterSpeed),0x80);
Notify(PSTR("\r\nWB:"),0x80);
Notify((char*)FindTitle<VT_WB, VT_WB_TEXT_LEN>(VT_WB_COUNT, WbTitles, dpWb),0x80);
Notify(PSTR("\r\nPict Style:"),0x80);
Notify((char*)FindTitle<VT_PSTYLE, VT_PSTYLE_TEXT_LEN>(VT_PSTYLE_COUNT, PStyleTitles, dpPStyle),0x80);
Notify(PSTR("\r\nISO:"),0x80);
Notify((char*)FindTitle<VT_ISO, VT_ISO_TEXT_LEN>(VT_ISO_COUNT, IsoTitles, dpIso),0x80);
Notify(PSTR("\r\nExp Comp:"),0x80);
Notify((char*)FindTitle<VT_EXPCOMP, VT_EXPCOMP_TEXT_LEN>(VT_EXPCOMP_COUNT, ExpCompTitles, dpExpComp),0x80);
Notify(PSTR("\r\n"),0x80);
}

QState EOSConsole::Initial(EOSConsole *me, QEvent const *e)
Expand Down
2 changes: 1 addition & 1 deletion examples/Canon_EOS/EOSRemote/EOSRemote.pde
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
{
stateConnected = stDisconnected;
//PTPPollTimer.Disable();
Notify(PSTR("Camera disconnected.\r\n"));
Notify(PSTR("Camera disconnected.\r\n"),0x80);

if (stateConnected == stConnected)
eosConsole.dispatch(&evtTick);
Expand Down
42 changes: 21 additions & 21 deletions examples/Canon_EOS/EOSRemote/eoseventhandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,45 +22,45 @@ void EosEventHandlers::OnPropertyChanged(const EOSEvent *evt)
{
case EOS_DPC_Aperture:
dpAperture = (uint8_t) evt->propValue;
Notify(PSTR("F:"));
Notify((char*)FindTitle<VT_APERTURE, VT_APT_TEXT_LEN>(VT_APT_COUNT, ApertureTitles, dpAperture));
Notify(PSTR("\r\n"));
Notify(PSTR("F:"),0x80);
Notify((char*)FindTitle<VT_APERTURE, VT_APT_TEXT_LEN>(VT_APT_COUNT, ApertureTitles, dpAperture),0x80);
Notify(PSTR("\r\n"),0x80);
break;
case EOS_DPC_ShutterSpeed:
dpShutterSpeed = (uint8_t) evt->propValue;
Notify(PSTR("T:"));
Notify((char*)FindTitle<VT_SHSPEED, VT_SHSPEED_TEXT_LEN>(VT_SHSPEED_COUNT, ShutterSpeedTitles, dpShutterSpeed));
Notify(PSTR("\r\n"));
Notify(PSTR("T:"),0x80);
Notify((char*)FindTitle<VT_SHSPEED, VT_SHSPEED_TEXT_LEN>(VT_SHSPEED_COUNT, ShutterSpeedTitles, dpShutterSpeed),0x80);
Notify(PSTR("\r\n"),0x80);
break;
case EOS_DPC_ShootingMode:
dpMode = (uint8_t) evt->propValue;
Notify(PSTR("Mode:"));
Notify((char*)FindTitle<VT_MODE, VT_MODE_TEXT_LEN>(VT_MODE_COUNT, ModeTitles, dpMode));
Notify(PSTR("\r\n"));
Notify(PSTR("Mode:"),0x80);
Notify((char*)FindTitle<VT_MODE, VT_MODE_TEXT_LEN>(VT_MODE_COUNT, ModeTitles, dpMode),0x80);
Notify(PSTR("\r\n"),0x80);
break;
case EOS_DPC_WhiteBalance:
dpWb = (uint8_t) evt->propValue;
Notify(PSTR("WB:"));
Notify((char*)FindTitle<VT_WB, VT_WB_TEXT_LEN>(VT_WB_COUNT, WbTitles, dpWb));
Notify(PSTR("\r\n"));
Notify(PSTR("WB:"),0x80);
Notify((char*)FindTitle<VT_WB, VT_WB_TEXT_LEN>(VT_WB_COUNT, WbTitles, dpWb),0x80);
Notify(PSTR("\r\n"),0x80);
break;
case EOS_DPC_PictureStyle:
dpPStyle = (uint8_t) evt->propValue;
Notify(PSTR("Pict Style:"));
Notify((char*)FindTitle<VT_PSTYLE, VT_PSTYLE_TEXT_LEN>(VT_PSTYLE_COUNT, PStyleTitles, dpPStyle));
Notify(PSTR("\r\n"));
Notify(PSTR("Pict Style:"),0x80);
Notify((char*)FindTitle<VT_PSTYLE, VT_PSTYLE_TEXT_LEN>(VT_PSTYLE_COUNT, PStyleTitles, dpPStyle),0x80);
Notify(PSTR("\r\n"),0x80);
break;
case EOS_DPC_Iso:
dpIso = (uint8_t) evt->propValue;
Notify(PSTR("ISO:"));
Notify((char*)FindTitle<VT_ISO, VT_ISO_TEXT_LEN>(VT_ISO_COUNT, IsoTitles, dpIso));
Notify(PSTR("\r\n"));
Notify(PSTR("ISO:"),0x80);
Notify((char*)FindTitle<VT_ISO, VT_ISO_TEXT_LEN>(VT_ISO_COUNT, IsoTitles, dpIso),0x80);
Notify(PSTR("\r\n"),0x80);
break;
case EOS_DPC_ExposureCompensation:
dpExpComp = (uint8_t) evt->propValue;
Notify(PSTR("Exp Comp:"));
Notify((char*)FindTitle<VT_EXPCOMP, VT_EXPCOMP_TEXT_LEN>(VT_EXPCOMP_COUNT, ExpCompTitles, dpExpComp));
Notify(PSTR("\r\n"));
Notify(PSTR("Exp Comp:"),0x80);
Notify((char*)FindTitle<VT_EXPCOMP, VT_EXPCOMP_TEXT_LEN>(VT_EXPCOMP_COUNT, ExpCompTitles, dpExpComp),0x80);
Notify(PSTR("\r\n"),0x80);
break;
};
}
Expand Down
2 changes: 1 addition & 1 deletion examples/Canon_EOS/yanis_ptp20/yanis_ptp20.pde
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
if (stateConnected)
{
stateConnected = false;
Notify(PSTR("Camera disconnected\r\n"));
Notify(PSTR("Camera disconnected\r\n"),0x80);
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/Canon_PS/PSCapture/PSCapture.pde
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void CamStateHandlers::OnDeviceDisconnectedState(PTP *ptp)
eventTimer.Disable();
captureTimer.Disable();

Notify(PSTR("Camera disconnected\r\n"));
Notify(PSTR("Camera disconnected\r\n"),0x80);
}
}

Expand All @@ -54,7 +54,7 @@ void CamStateHandlers::OnDeviceInitializedState(PTP *ptp)
if (stateConnected == stDisconnected || stateConnected == stInitial)
{
stateConnected = stConnected;
Notify(PSTR("Camera connected\r\n"));
Notify(PSTR("Camera connected\r\n"),0x80);
eventTimer.Enable();
captureTimer.Enable();
}
Expand Down
14 changes: 7 additions & 7 deletions examples/Canon_PS/PSCapture/pseventparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_
nStage ++;

case 1:
//Notify(PSTR("\r\nEvent Block Size:\t"));
//Notify(PSTR("\r\nEvent Block Size:\t"),0x80);
theBuffer.valueSize = 4;
valueParser.Initialize(&theBuffer);
nStage ++;
Expand All @@ -27,7 +27,7 @@ void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_
//PrintHex<uint32_t>(*((uint32_t*)theBuffer.pValue));
nStage ++;
case 3:
//Notify(PSTR("\r\nNumber of Fields:\t"));
//Notify(PSTR("\r\nNumber of Fields:\t"),0x80);
theBuffer.valueSize = 2;
valueParser.Initialize(&theBuffer);
nStage ++;
Expand All @@ -38,7 +38,7 @@ void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_
//PrintHex<uint16_t>(*((uint16_t*)theBuffer.pValue));
nStage ++;
case 5:
//Notify(PSTR("\r\nEvent Code:\t"));
//Notify(PSTR("\r\nEvent Code:\t"),0x80);
theBuffer.valueSize = 2;
valueParser.Initialize(&theBuffer);
nStage ++;
Expand All @@ -50,7 +50,7 @@ void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_
//PrintHex<uint16_t>(*((uint16_t*)theBuffer.pValue));
nStage ++;
case 7:
//Notify(PSTR("\r\nTransaction ID:\t"));
//Notify(PSTR("\r\nTransaction ID:\t"),0x80);
theBuffer.valueSize = 4;
valueParser.Initialize(&theBuffer);
nStage ++;
Expand All @@ -62,7 +62,7 @@ void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_
nStage ++;
case 9:
if (eventCode == PTP_EC_ObjectAdded)
Notify(PSTR("\r\nObject Added:\t\t"));
Notify(PSTR("\r\nObject Added:\t\t"),0x80);

theBuffer.valueSize = 4;
valueParser.Initialize(&theBuffer);
Expand All @@ -75,10 +75,10 @@ void PSEventParser::Parse(const uint16_t len, const uint8_t *pbuf, const uint32_

objHandle = *((uint32_t*)theBuffer.pValue);
PrintHex<uint32_t>(*((uint32_t*)theBuffer.pValue));
Notify(PSTR("\r\n"));
Notify(PSTR("\r\n"),0x80);
}
if (eventCode == PTP_EC_CaptureComplete)
Notify(PSTR("\r\nCapture complete.\r\n"));
Notify(PSTR("\r\nCapture complete.\r\n"),0x80);
nStage ++;
case 11:
nStage = 0;
Expand Down
Loading

0 comments on commit ae85f29

Please sign in to comment.