Updates for ne version of boost and using python3

This commit is contained in:
P.M. Kuipers 2023-01-14 15:49:42 +01:00
parent 0357e05623
commit 3cd8c0a0f6
5 changed files with 26 additions and 9 deletions

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
11

View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
import os,sys import os,sys
import glob import glob
@ -41,9 +41,9 @@ shutil.move(TARBALLNAME , os.path.join(DEBBUILDDIR,DEBSOURCEPKG))
os.chdir(DEBBUILDDIR) os.chdir(DEBBUILDDIR)
call(["tar","-xzvf",DEBSOURCEPKG]) call(["tar","-xzvf",DEBSOURCEPKG])
print "Entering dir " + PKGDIR print("Entering dir " + PKGDIR)
os.chdir(PKGDIR) os.chdir(PKGDIR)
print "Now in ", os.getcwd() print("Now in ", os.getcwd())
call(["dh_make --single --yes --copyright lgpl"],shell=True) call(["dh_make --single --yes --copyright lgpl"],shell=True)
for f in glob.glob(os.path.join(CWD,"debian","*")): for f in glob.glob(os.path.join(CWD,"debian","*")):

View File

@ -3,5 +3,5 @@
rm -r deb_dist rm -r deb_dist
rm version.py rm version.py
make version.py make version.py
python debpackager.py python3 debpackager.py

View File

@ -0,0 +1,12 @@
[Unit]
Description=Mediacore HID interface server
After=dbus.service
[Service]
Type=dbus
ExecStart=/usr/local/sbin/$NAME
BusName=nl.miqra.MediaCore.Hid
[Install]
WantedBy=multi-user.target

View File

@ -83,9 +83,11 @@ HidServer::HidServer(DBus::Connection &connection)
// Initialize button timer // Initialize button timer
btnTimer = new ButtonTimer(70,5000); // 70 ms debounce time, and a Long press takes 5 seconds btnTimer = new ButtonTimer(70,5000); // 70 ms debounce time, and a Long press takes 5 seconds
onShortPressConnection = this->btnTimer->onShortPress.connect( boost::bind( &HidServer::onShortPress, this, _1) ); // onShortPressConnection = this->btnTimer->onShortPress.connect( boost::bind( &HidServer::onShortPress, this, placeholders::_1) );
onLongPressConnection = this->btnTimer->onLongPress.connect( boost::bind( &HidServer::onLongPress, this, _1) ); // onLongPressConnection = this->btnTimer->onLongPress.connect( boost::bind( &HidServer::onLongPress, this, placeholders::_1) );
//onValidatePressConnection = this->btnTimer->onValidatePress.connect( boost::bind( &HidServer::onValidatePress, this, _1) ); onShortPressConnection = this->btnTimer->onShortPress.connect( [&](uint8_t gpio){ this->onShortPress(gpio); } );
onLongPressConnection = this->btnTimer->onLongPress.connect( [&](uint8_t gpio){ this->onLongPress(gpio); } );
//onValidatePressConnection = this->btnTimer->onValidatePress.connect( boost::bind( &HidServer::onValidatePress, this, placeholders::_1) );
// **** Initialize the GPIO Interrupt pin // **** Initialize the GPIO Interrupt pin
@ -99,7 +101,8 @@ HidServer::HidServer(DBus::Connection &connection)
clog << kLogInfo << "Connecting to Home button"; clog << kLogInfo << "Connecting to Home button";
this->btHome = new GpioPin(BTN_HOME); this->btHome = new GpioPin(BTN_HOME);
clog << kLogInfo << "."; clog << kLogInfo << ".";
onBtHomeConnection = this->btHome->onChange.connect( boost::bind( &HidServer::onBtChange, this, _1, _2, _3) ); // onBtHomeConnection = this->btHome->onChange.connect( boost::bind( &HidServer::onBtChange, this, placeholders::_1, placeholders::_2, placeholders::_3) );
onBtHomeConnection = this->btHome->onChange.connect( [&](uint8_t gpio, GpioEdge edge, bool level) {this->onBtChange(gpio,edge,level); });
clog << kLogInfo << "."; clog << kLogInfo << ".";
this->btHome->Listen(GpioEdge::Both, GpioPullup::PullUp, false); this->btHome->Listen(GpioEdge::Both, GpioPullup::PullUp, false);
clog << kLogInfo << "." << endl; clog << kLogInfo << "." << endl;
@ -108,7 +111,8 @@ HidServer::HidServer(DBus::Connection &connection)
clog << kLogInfo << "Connecting to other buttons"; clog << kLogInfo << "Connecting to other buttons";
this->btOther = new GpioPins(BUTTONS_REGULAR); this->btOther = new GpioPins(BUTTONS_REGULAR);
clog << kLogInfo << "."; clog << kLogInfo << ".";
onBtOtherConnection = this->btOther->onChange.connect( boost::bind( &HidServer::onBtChange, this, _1, _2, _3) ); // onBtOtherConnection = this->btOther->onChange.connect( boost::bind( &HidServer::onBtChange, this, placeholders::_1, placeholders::_2, placeholders::_3) );
onBtOtherConnection = this->btOther->onChange.connect( [&](uint8_t gpio, GpioEdge edge, bool level){ this->onBtChange(gpio,edge,level); } );
clog << kLogInfo << "."; clog << kLogInfo << ".";
this->btOther->Listen(GpioEdge::Both, GpioPullup::PullUp, true); this->btOther->Listen(GpioEdge::Both, GpioPullup::PullUp, true);
clog << kLogInfo << "." << endl; clog << kLogInfo << "." << endl;