• May 02, 2024, 04:14:04 am

Author Topic: QCenRep wrapper  (Read 3796 times)

0 Members and 1 Guest are viewing this topic.

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
QCenRep wrapper
« on: January 16, 2014, 12:42:44 am »
Hello,
I wrote a little central repository wrapper for Qt based apps.

1. Preconditions:

a) in your .pro file:

- link against centralrepository via:
Code: [Select]
LIBS += -lcentralrepositorydepending on the cenrep keys you're reading/writing you have to modify the capabilities of your app.

- add QCenRep.cpp to SOURCES +=
- add QCenRep.h to HEADERS +=

b) in your implementation include the wrapper via
Code: [Select]
#include "QCenRep.h"
2. How to use it:

        - all calls are static
        - to get a CenRep key's value use this format:

                getCenrep(int iUID, int iKey);
                getCenrep(QString iUID, QString iKey);
                getCenrep(char *iUID, char *iKey);

          it always will return a QString, you don't have to care about the original format (int or string). If the key doesn't exist you will get "Missing key!"
         

        - to set a new value:

                setCenrep(int iUID, int iKey, QString qValue);
                setCenrep(int iUID, int iKey, const char *qValue);
                setCenrep(QString iUID, QString iKey, QString qValue);
                setCenrep(const char *iUID, const char *iKey, const char *qValue);

           the type of the value (string or int) gets detected, you don't have to worry about it.

    Example code:

        get the current product improvment status:

            qDebug() << QCenRep::getCenrep(0x2003e081, 0x1);
            qDebug() << QCenRep::getCenrep(QString("0x2003e081"), QString("0x1"));
            qDebug() << QCenRep::getCenrep("0x2003e081", "0x1");

        disable product improvment:

            QCenRep::setCenrep(0x2003e081, 0x1, QString("0"));
            QCenRep::setCenrep(0x2003e081, 0x1, "0");
            QCenRep::setCenrep(QString("0x2003e081"), QString("0x1"), QString("0"));
            QCenRep::setCenrep("0x2003e081", "0x1", "0");


maybe something is buggy, doesn't work or causes problems I didn't test it very much and it's a bit old.

thanks faenil for his cenrep example code from:
https://github.com/faenil/i8910tuning/blob/master/i8910tuning.cpp

GitHub repo: https://github.com/huellif/QCenRep
« Last Edit: January 20, 2014, 12:01:04 am by huellif »

Offline matthew

  • Mass Poster
  • ****
  • Posts: 1,315
  • Reputation: 13
  • SymphonyOS
  • Current Phone: :
    N8-00 (25.007)
    808 (113.010.1508)
    Retired E72, E6-00
Re: QCenRep wrapper
« Reply #1 on: January 16, 2014, 12:58:23 am »
:D
Nice share, mate. i'll test anything for you ;)

Offline Allstar12345

  • Allstar Software Founder
  • Administrator
  • Forum Genius
  • ******
  • Posts: 5,235
  • Reputation: 812
    • Allstar Software
  • Current Phone: : OnePlus 8 Pro, Xperia 10, Nexus 6p, Jolla Phone, Nokia N8, Nokia 808 PureView, BlackBerry Z30
Re: QCenRep wrapper
« Reply #2 on: January 16, 2014, 01:28:19 am »
Would make that settings Qt App on DMF a whole lot more possible.

Offline Motaz

  • Developer
  • Forum User
  • ****
  • Posts: 62
  • Reputation: 72
  • Symbian Power User
  • Current Phone: : Nokia 700
Re: QCenRep wrapper
« Reply #3 on: January 16, 2014, 04:52:17 am »
Thank you huellif ;)
Did you known how to change number mode from Hindi to Arabic?
I known it stored in 101F8780 and I try this but not worked :(

Code: [Select]
QCenRep::setCenrep("0x101f8780", "0x1", "0");

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: QCenRep wrapper
« Reply #4 on: January 16, 2014, 07:16:16 pm »
Thank you huellif ;)
Did you known how to change number mode from Hindi to Arabic?
I known it stored in 101F8780 and I try this but not worked :(

Code: [Select]
QCenRep::setCenrep("0x101f8780", "0x1", "0");

set 0x1 to 0 and 0x2 to 1

[via]

Would make that settings Qt App on DMF a whole lot more possible.

project seems to be dead
« Last Edit: January 16, 2014, 07:17:08 pm by huellif »

Offline Motaz

  • Developer
  • Forum User
  • ****
  • Posts: 62
  • Reputation: 72
  • Symbian Power User
  • Current Phone: : Nokia 700
Re: QCenRep wrapper
« Reply #5 on: January 17, 2014, 01:57:05 am »
set 0x1 to 0 and 0x2 to 1

[via]
It's not work .. I test it on Nokia 700 Belle FP2 :(

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: QCenRep wrapper
« Reply #6 on: January 17, 2014, 10:45:11 pm »
seems like the old method has stopped working :-\
did you check the .txt in an arabic firmware?

Offline Motaz

  • Developer
  • Forum User
  • ****
  • Posts: 62
  • Reputation: 72
  • Symbian Power User
  • Current Phone: : Nokia 700
Re: QCenRep wrapper
« Reply #7 on: January 17, 2014, 11:15:03 pm »
Yes and there it's:
Code: [Select]
cenrep
version 1
[owner]
0x100058EC
[defaultmeta]
 16777216
[platsec]
 cap_rd=alwayspass cap_wr=WriteDeviceData
[Main]
0x1 int 0 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
0x2 int 0 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
« Last Edit: January 17, 2014, 11:15:38 pm by Motaz »

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: QCenRep wrapper
« Reply #8 on: January 19, 2014, 04:47:12 pm »
did you add wtite devicedata to your app?

Use qDebug() << to get the current status of both entries.

Offline Motaz

  • Developer
  • Forum User
  • ****
  • Posts: 62
  • Reputation: 72
  • Symbian Power User
  • Current Phone: : Nokia 700
Re: QCenRep wrapper
« Reply #9 on: January 19, 2014, 05:43:18 pm »
did you add wtite devicedata to your app?

Use qDebug() << to get the current status of both entries.
Yes, The value saved but the number mode not changed !

Offline huellif

  • Developer
  • Christmas Santa
  • ****
  • Posts: 402
  • Reputation: 212
Re: QCenRep wrapper
« Reply #10 on: February 04, 2014, 12:43:06 am »
sorry for delay, I did a little research but didn't found something useful