Skip to content
Permalink
Browse files

Added TODOs for device driver changes

- Marked all hard coded script launcher
- Small qDebug improvements
- File permission cleanup
  • Loading branch information
zehnm committed Dec 1, 2019
1 parent 6965a22 commit be09699875f3cf17cce3683cd9a695dd6447dbf1
0 ButtonHandler.qml 100755 β†’ 100644
No changes.
0 DEV ENVIRONMENT.md 100755 β†’ 100644
No changes.
0 MainContainer.qml 100755 β†’ 100644
No changes.
0 README.md 100755 β†’ 100644
No changes.
@@ -29,8 +29,10 @@ Rectangle {
onStartAnimFinishedChanged: {
if (startAnimFinished) {
console.debug("NOW SHUTDOWN");
// TODO create a framebuffer device class instead of launching hard coded shell scripts from QML
launcher.launch("fbv -d 1 /bye.png")
buttonHandler.interruptHandler.shutdown();
// TODO create a device class for system shutdown instead of launching hard coded shell scripts from QML
launcher.launch("halt");
}
}
@@ -62,6 +62,7 @@ Item {

checked: false
mouseArea.onClicked: {
// TODO create a web server launcher class or at least a configurable command instead of launching hard coded shell scripts from QML
if (remoteConfigButton.checked) {
remoteConfigLauncher.launch("systemctl start lighttpd.service");
remoteConfigButton.checked = true;
@@ -136,6 +136,7 @@ Item {
mouseArea.onClicked: {
if (updateAvailable) {
console.debug("Updating the app")
// TODO create a update servcie class instead of launching hard coded shell scripts from QML
fileio.write("/usr/bin/updateURL", updateURL);
mainLauncher.launch("systemctl restart update.service");
}
@@ -21,6 +21,7 @@ Item {
triggeredOnStart: true

onTriggered: {
// TODO create a device class instead of launching hard coded shell scripts from QML
uptimeValue.text = settingsLauncher.launch("/usr/bin/yio-remote/uptime.sh").trim();
temperatureValue.text = Math.round(parseInt(settingsLauncher.launch("cat /sys/class/thermal/thermal_zone0/temp"))/1000) + "ΒΊC";
}
@@ -135,8 +136,10 @@ Item {
anchors.leftMargin: (parent.width - (buttonReboot.width + buttonShutdown.width + 40))/2

mouseArea.onClicked: {
// TODO create a framebuffer device class instead of launching hard coded shell scripts from QML
settingsLauncher.launch("fbv -d 1 /bye.png")
console.debug("now reboot")
// TODO create a device class for system reboot instead of launching hard coded shell scripts from QML
settingsLauncher.launch("reboot");
}
}
0 images.qrc 100755 β†’ 100644
No changes.
1 main.qml 100755 β†’ 100644
@@ -199,6 +199,7 @@ ApplicationWindow {
if (updateAvailable) {
var hour = new Date().getHours();
if (hour >= 3 && hour <= 5) {
// TODO create a update service class instead of launching hard coded shell scripts from QML
fileio.write("/usr/bin/updateURL", updateURL);
mainLauncher.launch("systemctl restart update.service");
Qt.quit();
0 qml.qrc 100755 β†’ 100644
No changes.
@@ -1,4 +1,5 @@
function checkForUpdate() {
// TODO create a update service device class instead of launching hard coded shell scripts from QML
var response = mainLauncher.launch("curl -L https://api.github.com/repos/martonborzak/yio-remote/releases/latest");
var obj = JSON.parse(response);
if (obj.tag_name >= _current_version + 0.1) {
Binary file not shown.
@@ -117,6 +117,8 @@ BluetoothThread::BluetoothThread(QMap<QString, QString> areas, int interval)
qDebug() << "Bluetooth init OK";

} else {
qCritical() << "Bluetooth device was not found.";
// TODO translate Bluetooth notification
Notifications::getInstance()->add(true,"Bluetooth device was not found.");
}
}
0 sources/entities/blind.cpp 100755 β†’ 100644
No changes.
0 sources/entities/blind.h 100755 β†’ 100644
No changes.
0 sources/entities/entities.cpp 100755 β†’ 100644
No changes.
0 sources/entities/entities.h 100755 β†’ 100644
No changes.
0 sources/entities/entitiesinterface.h 100755 β†’ 100644
No changes.
0 sources/entities/entity.cpp 100755 β†’ 100644
No changes.
0 sources/entities/entity.h 100755 β†’ 100644
No changes.
0 sources/entities/light.cpp 100755 β†’ 100644
No changes.
0 sources/entities/light.h 100755 β†’ 100644
No changes.
1 sources/hardware/apds9960.cpp 100755 β†’ 100644
@@ -22,6 +22,7 @@ bool APDS9960::check()

bool APDS9960::begin(uint16_t iTimeMS, apds9960AGain_t aGain)
{
// TODO make i2c device configurable
_fd = wiringPiI2CSetupInterface("/dev/i2c-3", APDS9960_ADDRESS);
if(_fd == -1) {
return false;
0 sources/hardware/apds9960.h 100755 β†’ 100644
No changes.
3 sources/hardware/bq27441.cpp 100755 β†’ 100644
@@ -6,6 +6,7 @@ BQ27441::BQ27441()
{
#ifdef __arm__
/* Initialize I2C */
// TODO make i2c device configurable
bus = wiringPiI2CSetupInterface("/dev/i2c-3", BQ27441_I2C_ADDRESS);

uint16_t bq27441_device_id;
@@ -17,7 +18,7 @@ BQ27441::BQ27441()
if (bq27441_device_id != BQ27441_DEVICE_ID)
{
m_init = false;
qDebug() << "Error: Unable to communicate with BQ27441.";
qCritical() << "Error: Unable to communicate with BQ27441.";
Notifications::getInstance()->add(true,tr("Cannot initialize the battery sensor. Please restart the remote."));
} else {
m_init = true;
0 sources/hardware/bq27441.h 100755 β†’ 100644
No changes.
0 sources/hardware/display_control.cpp 100755 β†’ 100644
No changes.
0 sources/hardware/display_control.h 100755 β†’ 100644
No changes.
1 sources/hardware/drv2605.cpp 100755 β†’ 100644
@@ -40,6 +40,7 @@ bool drv2605::init()
{
#ifdef __arm__
wiringPiSetup();
// TODO make i2c device configurable
bus = wiringPiI2CSetupInterface("/dev/i2c-3", DRV2605_ADDR);

// int id = readRegister8(DRV2605_REG_STATUS);
0 sources/hardware/drv2605.h 100755 β†’ 100644
No changes.
0 sources/hardware/interrupt_handler.h 100755 β†’ 100644
No changes.
1 sources/hardware/mcp23017.h 100755 β†’ 100644
@@ -53,6 +53,7 @@ class MCP23017
{
wiringPiSetup();

// TODO make i2c device configurable
bus = wiringPiI2CSetupInterface("/dev/i2c-3", MCP23017_ADDRESS);

// set up all inputs on both ports
@@ -82,7 +82,10 @@ class ProximityGestureControl : public QObject
#ifdef __arm__
if (m_init_success) {
m_proximity = apds.readProximity();
qDebug() << "Proximity" << m_proximity;
if (m_proximity > 0) {
// prevent log flooding while docking
qDebug() << "Proximity" << m_proximity;
}

if (m_proximityDetection) {

@@ -110,7 +113,7 @@ class ProximityGestureControl : public QObject
#ifdef __arm__
// intialize the sensor
if (!apds.begin()) {
qDebug() << "Cannot initialise the APDS9960 sensor";
qCritical() << "Cannot initialise the APDS9960 sensor";
//: Error message that shows up as notification when light value cannot be read
// m_apds9960Error = tr("Cannot initialize the proximity sensor. Please restart the remote.");
m_init_success = false;
0 sources/hardware/touchdetect.h 100755 β†’ 100644
No changes.
0 sources/integrations/integration.h 100755 β†’ 100644
No changes.
No changes.
0 sources/jsonfile.cpp 100755 β†’ 100644
No changes.
0 sources/jsonfile.h 100755 β†’ 100644
No changes.
0 sources/launcher.cpp 100755 β†’ 100644
No changes.
0 sources/launcher.h 100755 β†’ 100644
No changes.
0 sources/translation.h 100755 β†’ 100644
No changes.
0 translations.qrc 100755 β†’ 100644
No changes.
@@ -83,8 +83,10 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter

mouseArea.onClicked: {
// TODO create a framebuffer device class instead of launching hard coded shell scripts from QML
mainLauncher.launch("fbv -d 1 /bye.png")
buttonHandler.interruptHandler.shutdown();
// TODO create a system device class for shutdown instead of launching hard coded shell scripts from QML
mainLauncher.launch("halt");
}
}
@@ -291,6 +293,7 @@ Item {
anchors.leftMargin: 20

mouseArea.onClicked: {
// TODO create a system device class for reboot instead of launching hard coded shell scripts from QML
mainLauncher.launch("reboot");
}
}
@@ -344,7 +347,9 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter

mouseArea.onClicked: {
// TODO create a framebuffer device class instead of launching hard coded shell scripts from QML
mainLauncher.launch("fbv -d 1 /bye.png")
// TODO create a system device class for reboot instead of launching hard coded shell scripts from QML
mainLauncher.launch("reboot");
}
}

0 comments on commit be09699

Please sign in to comment.
You can’t perform that action at this time.