Click here to Skip to main content
15,797,052 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CreateProcess lpApplicationName param Pin
ForNow24-Jul-18 2:42
ForNow24-Jul-18 2:42 
QuestionTechnical Interview Preparation Pin
Member 1392070221-Jul-18 1:50
Member 1392070221-Jul-18 1:50 
AnswerRe: Technical Interview Preparation Pin
Richard MacCutchan21-Jul-18 2:12
mveRichard MacCutchan21-Jul-18 2:12 
AnswerRe: Technical Interview Preparation Pin
CPallini22-Jul-18 22:52
mveCPallini22-Jul-18 22:52 
QuestionAPI to change win10 touchpad 'Cursor speed' dynamically without restarting Pin
AroraSaurabh19-Jul-18 7:59
AroraSaurabh19-Jul-18 7:59 
GeneralRe: API to change win10 touchpad 'Cursor speed' dynamically without restarting Pin
Richard MacCutchan19-Jul-18 22:24
mveRichard MacCutchan19-Jul-18 22:24 
AnswerRe: API to change win10 touchpad 'Cursor speed' dynamically without restarting Pin
Randor 20-Jul-18 22:30
professional Randor 20-Jul-18 22:30 
QuestionRegistering a IOT Device in C++ Pin
Member 1391379016-Jul-18 10:20
Member 1391379016-Jul-18 10:20 
The C++ API doesn't seem to provide a similar registration interface for device as is provided by the Java. Before I forge ahead and write on myself I want to verify I am not overlooking anything.

The Java API that (I believe) accomplishes registration of a device is:

/** Create a device that is authenticated using ES256. */
public static void createDeviceWithEs256(String deviceId, String publicKeyFilePath,
    String projectId, String cloudRegion, String registryName)
    throws GeneralSecurityException, IOException {
  GoogleCredential credential =
      GoogleCredential.getApplicationDefault().createScoped(CloudIotScopes.all());
  JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
  HttpRequestInitializer init = new RetryHttpInitializerWrapper(credential);
  final CloudIot service = new CloudIot.Builder(
      GoogleNetHttpTransport.newTrustedTransport(),jsonFactory, init)
      .setApplicationName(APP_NAME).build();

  final String registryPath = String.format("projects/%s/locations/%s/registries/%s",
      projectId, cloudRegion, registryName);

  PublicKeyCredential publicKeyCredential = new PublicKeyCredential();
  final String key = Files.toString(new File(publicKeyFilePath), Charsets.UTF_8);
  publicKeyCredential.setKey(key);
  publicKeyCredential.setFormat("ES256_PEM");

  DeviceCredential devCredential  = new DeviceCredential();
  devCredential.setPublicKey(publicKeyCredential);

  System.out.println("Creating device with id: " + deviceId);
  Device device = new Device();
  device.setId(deviceId);
  device.setCredentials(Arrays.asList(devCredential));

  Device createdDevice =
      service
          .projects()
          .locations()
          .registries()
          .devices()
          .create(registryPath, device)
          .execute();

  System.out.println("Created device: " + createdDevice.toPrettyString());
}


[^]


Any comments much appreciated.

Tom
GeneralRe: Registering a IOT Device in C++ Pin
Richard MacCutchan17-Jul-18 3:03
mveRichard MacCutchan17-Jul-18 3:03 
QuestionCChildFrame in separate thread Pin
_Flaviu15-Jul-18 23:06
_Flaviu15-Jul-18 23:06 
AnswerRe: CChildFrame in separate thread Pin
Jochen Arndt15-Jul-18 23:37
professionalJochen Arndt15-Jul-18 23:37 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu15-Jul-18 23:52
_Flaviu15-Jul-18 23:52 
GeneralRe: CChildFrame in separate thread Pin
Jochen Arndt16-Jul-18 0:21
professionalJochen Arndt16-Jul-18 0:21 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu16-Jul-18 1:36
_Flaviu16-Jul-18 1:36 
GeneralRe: CChildFrame in separate thread Pin
Jochen Arndt16-Jul-18 1:41
professionalJochen Arndt16-Jul-18 1:41 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu16-Jul-18 2:27
_Flaviu16-Jul-18 2:27 
GeneralRe: CChildFrame in separate thread Pin
Jochen Arndt16-Jul-18 3:49
professionalJochen Arndt16-Jul-18 3:49 
GeneralRe: CChildFrame in separate thread Pin
_Flaviu16-Jul-18 4:07
_Flaviu16-Jul-18 4:07 
QuestionTrace a CString Pin
_Flaviu14-Jul-18 23:26
_Flaviu14-Jul-18 23:26 
AnswerRe: Trace a CString Pin
Richard MacCutchan15-Jul-18 3:00
mveRichard MacCutchan15-Jul-18 3:00 
SuggestionRe: Trace a CString Pin
David Crow15-Jul-18 17:27
David Crow15-Jul-18 17:27 
GeneralRe: Trace a CString Pin
_Flaviu15-Jul-18 23:04
_Flaviu15-Jul-18 23:04 
SuggestionRe: Trace a CString Pin
David Crow16-Jul-18 2:48
David Crow16-Jul-18 2:48 
GeneralRe: Trace a CString Pin
tony.attwood@ntlworld.com5-May-23 7:00
tony.attwood@ntlworld.com5-May-23 7:00 
AnswerRe: Trace a CString Pin
Jochen Arndt16-Jul-18 0:12
professionalJochen Arndt16-Jul-18 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.