SWIGJAVA: Remove the last JAVA ifdefs from src

Removed all references to #ifdef SWIGJAVA and JAVACALLBACK from the
library source.  All java-specific source code has been moved to the
corresponding library's .i file for java.

    * Update library source
    * Update examples where necessary
    * The function pointer methodology has been remove from libraries
      which provided callbacks as both a class and a function pointer
      implementation.  Examples were updated to use the class version
      of callbacks.
    * Updated documentation for SWIGJAVA

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2018-01-23 11:58:12 -08:00
parent d49ab2ac95
commit 666452e873
44 changed files with 280 additions and 509 deletions

View File

@ -46,10 +46,21 @@ sig_handler(int signo)
}
}
void
nrf_handler()
class mycb : public virtual Callback
{
}
public:
mycb(upm::NRF24L01 *com) : _com(com) {}
virtual void run()
{
if (_com != NULL)
std::cout << "Reciever :: " << *((uint32_t*) &(_com->m_rxBuffer[0])) << std::endl;
else
std::cout << "Example callback!" << std::endl;
}
private:
upm::NRF24L01* _com;
};
int
main(int argc, char** argv)
@ -57,12 +68,14 @@ main(int argc, char** argv)
//! [Interesting]
uint32_t dummyData = 0;
upm::NRF24L01 comm(7, 8);
mycb cb(&comm);
comm.setSourceAddress((uint8_t*) srcAddress);
comm.setDestinationAddress((uint8_t*) destAddress);
comm.setPayload(MAX_BUFFER);
comm.setChannel(99);
comm.configure();
comm.setDataReceivedHandler(nrf_handler);
comm.setDataReceivedHandler(&cb);
signal(SIGINT, sig_handler);