HPMA115S0 icon indicating copy to clipboard operation
HPMA115S0 copied to clipboard

fix casesensitive headers and invalid char conversions

Open hpsaturn opened this issue 6 years ago • 3 comments

It fixed Invalid conversion from 'const char*' to 'char*' [-fpermissive]

hpsaturn avatar Jun 06 '18 17:06 hpsaturn

I'm not sure I understand the last commit. It seems to revert the earlier commit, reverting unsigned char back to char. For me (AVR-based Arduino), the last commit breaks compilation again. With d0de9b637924c81c805a98118bc7559c07e28340 it works, with 0ac58d940d92aa65e0531f141247bf3991192ebf I get:

   hpma115S0.cpp: In member function 'boolean HPMA115S0::ReadParticleMeasurement(unsigned int*, unsigned int*)':
   hpma115S0.cpp:117:42: error: narrowing conversion of '147' from 'int' to 'char' inside { } [-Wnarrowing]
      char cmdBuf[] = {0x68, 0x01, 0x04, 0x93};

(and a few more of the same one)

In any case, this is about binary data, so it would seem sensible to use unsigned char everywhere rather than char?

matthijskooijman avatar Dec 28 '18 12:12 matthijskooijman

Please check if the hpsaturn fork works for you, @matthijskooijman .

AlexFBP avatar Dec 30 '18 05:12 AlexFBP

@hpsaturn may you do a fast forward in your branch fix_esp32? I marked #11 as duplicate... most of comits came from you and I requested you this pull you aplied in your fork haha

AlexFBP avatar Jan 04 '19 19:01 AlexFBP