Javascriptsmbus.writeObject( {7: 0, 2: 0, 3: 0, "4": 0} )
C++ (Qt)Q_INVOKABLE QVariantMap writePairs( const QList<QVariantMap> &data ) const;
Javascript var t = {7: 0} var d = [t, t, t]; console.log( d ) var r = smbus.writePairs( d )
[[object Object],[object Object],[object Object]]
C++ (Qt) for( QVariantMap::const_iterator b(data.begin( )), e(data.end( )); b!=e; ++b ) { std::cout << b.key( ).toInt( ) << ":" << b.value( ).toInt( ) << "; "; }
2:0; 3:0; 4:0; 7:0;
C++ (Qt) function setEnable( value ) { var data = {7: value ? 1 : 0} smbus.writeBytes( data ) }
C++ (Qt) function setCode( code, a, b, c ) { var data = [{0x3c: code}, {0x20: a, 0x21: b, 0x22: c} ] smbus.writeBytes( data ) }