Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » adc(Access the adc)
adc [message #1779625] Wed, 10 January 2018 11:38 Go to next message
gopal korrapati is currently offline gopal korrapatiFriend
Messages: 48
Registered: October 2017
Member
The following is ADC bundle code that i've added.
And the code raises errors, check the attachment.
Expecting suggestion to resolve it.

package org.eclipse.kura.example.ioadc;

import java.io.IOException;

import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jdk.dio.DeviceConfig;
import jdk.dio.DeviceManager;
import jdk.dio.DeviceNotFoundException;
import jdk.dio.InvalidDeviceConfigException;
import jdk.dio.UnavailableDeviceException;
import jdk.dio.UnsupportedDeviceTypeException;
import jdk.dio.adc.ADCChannel;
import jdk.dio.adc.ADCChannelConfig;

public class ioadc {

private static final Logger s_logger = (Logger) LoggerFactory.getLogger(ioadc.class);

private static final String APP_ID = "org.eclipse.kura.ioadc";

protected void activate(ComponentContext componentContext) {
ADCChannel channel = null;

s_logger.info("Bundle " + APP_ID + " is activating...");
ADCChannelConfig config = new ADCChannelConfig(DeviceConfig.DEFAULT, 4, 12, 10, 10);
try {
channel = DeviceManager.open(4);
} catch (InvalidDeviceConfigException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedDeviceTypeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (DeviceNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnavailableDeviceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
channel.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

protected void deactivate(ComponentContext componentContext) {

s_logger.info("Bundle " + APP_ID + " has deactivated!");

}
}




  • Attachment: adc.png
    (Size: 300.59KB, Downloaded 158 times)
  • Attachment: adc1.png
    (Size: 323.69KB, Downloaded 206 times)

[Updated on: Wed, 10 January 2018 11:54]

Report message to a moderator

Re: adc [message #1779645 is a reply to message #1779625] Wed, 10 January 2018 17:40 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
did you check to have jdk.dio available in your target system?

Best regards,
Matteo
Re: adc [message #1779675 is a reply to message #1779645] Thu, 11 January 2018 05:29 Go to previous messageGo to next message
gopal korrapati is currently offline gopal korrapatiFriend
Messages: 48
Registered: October 2017
Member
Yes in my Target having the jdk.dio. recently I also worked on I2C .
The following is Manifest code that i've added.
check the attachment.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ioadc
Bundle-SymbolicName: org.eclipse.kura.example.ioadc
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: jdk.dio;version="1.0.200",
jdk.dio.adc;version="1.0.200",
org.eclipse.kura;version="1.4.0",
org.osgi.service.component;version="1.2.2",
org.slf4j;version="1.7.21"
Service-Component: OSGI-INF/component.xml

Re: adc [message #1779951 is a reply to message #1779675] Tue, 16 January 2018 07:06 Go to previous messageGo to next message
gopal korrapati is currently offline gopal korrapatiFriend
Messages: 48
Registered: October 2017
Member
Anybody please give me answer.
Re: adc [message #1779956 is a reply to message #1779951] Tue, 16 January 2018 08:15 Go to previous message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
honestly we never tried ADC.
Maybe someone else in the forum can give you some help.

Best regards,
Matteo
Previous Topic:Kura built-in Simple Artemis MQTT Broker Service logs
Next Topic:Kura Modbus
Goto Forum:
  


Current Time: Fri Apr 26 08:09:05 GMT 2024

Powered by FUDForum. Page generated in 0.03295 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top