changeset 235:76a790a79cd3

DIO-3: MPC3008 example build error Summary: Added missed functions Reviewed-by: alkonsta
author snazarki
date Thu, 24 Sep 2015 19:32:24 +0400
parents 4299ff23b184
children ddc484c7916a
files samples/spi/src/dio/spi/MCP3008Config.java samples/spi/src/dio/spi/MCP3008Impl.java samples/spi/src/dio/spi/MCP3008Provider.java
diffstat 3 files changed, 38 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/samples/spi/src/dio/spi/MCP3008Config.java	Wed Sep 23 12:47:26 2015 +0400
+++ b/samples/spi/src/dio/spi/MCP3008Config.java	Thu Sep 24 19:32:24 2015 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,7 +30,11 @@
  */
 package dio.spi;
 
+import java.io.IOException;
+import java.io.OutputStream;
+
 import jdk.dio.*;
+import jdk.dio.DeviceConfig;
 import jdk.dio.spibus.*;
 
 /*
@@ -49,4 +53,9 @@
     public int getDeviceNumber() {
         return this.deviceNumber;
     }
+
+    @Override
+    public int serialize(OutputStream out) throws IOException {
+        return 0;
+    }
 }
--- a/samples/spi/src/dio/spi/MCP3008Impl.java	Wed Sep 23 12:47:26 2015 +0400
+++ b/samples/spi/src/dio/spi/MCP3008Impl.java	Thu Sep 24 19:32:24 2015 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,10 +32,20 @@
 package dio.spi;
 
 import java.io.*;
+import java.io.IOException;
 import java.nio.*;
+import java.nio.ByteBuffer;
+
 import jdk.dio.*;
+import jdk.dio.DeviceConfig;
+import jdk.dio.DeviceManager;
+import jdk.dio.DeviceNotFoundException;
+import jdk.dio.UnavailableDeviceException;
+import jdk.dio.UnsupportedDeviceTypeException;
 import jdk.dio.spi.*;
+import jdk.dio.spi.AbstractDevice;
 import jdk.dio.spibus.*;
+import jdk.dio.spibus.SPIDevice;
 
 /*
  * MCP3008Impl
@@ -88,4 +98,9 @@
         }
     }
 
+    @Override
+    public java.nio.ByteOrder getByteOrder() {
+        return java.nio.ByteOrder.nativeOrder();
+    }
+
 }
--- a/samples/spi/src/dio/spi/MCP3008Provider.java	Wed Sep 23 12:47:26 2015 +0400
+++ b/samples/spi/src/dio/spi/MCP3008Provider.java	Thu Sep 24 19:32:24 2015 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -31,8 +31,14 @@
 package dio.spi;
 
 import java.io.*;
+import java.io.IOException;
+
 import jdk.dio.*;
+import jdk.dio.DeviceConfig;
+import jdk.dio.DeviceException;
 import jdk.dio.spi.*;
+import jdk.dio.spi.AbstractDevice;
+import jdk.dio.spi.DeviceProvider;
 
 /*
  * MCP3008Provider
@@ -69,4 +75,9 @@
         }
         return false;
     }
+
+    @Override
+    public DeviceConfig<? super MCP3008> deserialize(java.io.InputStream in) {
+        return null;
+    }
 }