Skip to content
Permalink
Browse files

Add gpControlSet

  • Loading branch information...
KonradIT committed Jun 13, 2017
1 parent 3271991 commit fcc6ec60122266a4852fa5978af86abea656f911
@@ -3,5 +3,5 @@

gpCamera = Camera.new
gpCamera.camera_mode(Mode::MultiShotMode, Mode::SubMode::MultiShot::Burst)
gpCamera.gpControlCommand(Multishot::BURST_RATE, Multishot::BurstRate::B5_1)
gpCamera.shutter(Shutter::ON)
gpCamera.gpControlSet(Multishot::BURST_RATE, Multishot::BurstRate::B5_1)
gpCamera.shutter(Shutter::ON)
@@ -5,10 +5,10 @@
count=0
brackets=["0","4","8"]
while count < brackets.size
gpCamera.gpControlCommand(Photo::EVCOMP, brackets[count])
gpCamera.gpControlSet(Photo::EVCOMP, brackets[count])
count += 1
puts "Photo: " + count.to_s
sleep 1
gpCamera.shutter(Shutter::ON)
sleep 1
end
end
@@ -2,5 +2,5 @@
require '../lib/constants'
gpCamera = Camera.new
gpCamera.camera_mode(Mode::VideoMode, Mode::SubMode::Video::Video)
gpCamera.gpControlCommand(Video::RESOLUTION, Video::Resolution::R1440p)
gpCamera.shutter(Shutter::ON)
gpCamera.gpControlSet(Video::RESOLUTION, Video::Resolution::R1440p)
gpCamera.shutter(Shutter::ON)
BIN -8 KB goprocam-1.2.2.gem
Binary file not shown.
BIN +8 KB goprocam-1.2.3.gem
Binary file not shown.
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'goprocam'
s.version = '1.2.2'
s.date = '2017-03-11'
s.version = '1.2.3'
s.date = '2017-06-13'
s.summary = "Interface for your WiFi GoPro camera."
s.description = "Control and view status from your GoPro HERO4/HERO5 camera via WiFi."
s.authors = ["Konrad Iturbe"]
@@ -14,11 +14,14 @@ def initialize()
status(Status::Status, Status::STATUS::IsConnected)
end
end
def gpControlCommand(param,value)
def gpControlSet(param,value)
response = open(GOPROCONTROL + 'setting/' + param + '/' + value).read
puts response
end

def gpControlCommand(param)
response = open(GOPROCONTROL + 'command/' + param).read
puts response
end
def status_raw()
response = open(GOPROCONTROL + 'status').read
puts response
@@ -172,7 +175,7 @@ def overview()
puts "serial number: ", " " + info_camera(Camera::SerialNumber)
end
def shutter(value)
response = open(GOPROCONTROL + 'command/shutter?p=' + value).read
response = gpControlCommand('shutter?p=' + value)
puts response
end
def take_photo()
@@ -183,38 +186,38 @@ def take_photo()
shutter(Shutter::ON)
end
def camera_mode(mode, submode="0")
response = open(GOPROCONTROL + 'command/sub_mode?mode=' + mode + '&sub_mode=' + submode).read
response = gpControlCommand('sub_mode?mode=' + mode + '&sub_mode=' + submode)
puts response
end

def delete(option)
response = open(GOPROCONTROL + 'command/storage/delete/' + option).read
response = gpControlCommand('storage/delete/' + option)
puts response
end

def delete_file(folder,file)
response = open(GOPROCONTROL + 'command/storage/delete?p=' + folder + "/" + file).read
response = gpControlCommand('storage/delete?p=' + folder + "/" + file)
puts response
end

def locate(param)
response = open(GOPROCONTROL + 'command/system/locate?p=' + param).read
response = gpControlCommand('system/locate?p=' + param)
puts response
end

def hilight()
response = open(GOPROCONTROL + 'command/storage/tag_moment').read
response = gpControlCommand('storage/tag_moment')
puts response
end

def power_off()
response = open(GOPROCONTROL + 'command/system/sleep').read
response = gpControlCommand('system/sleep')
puts response
end


def ap_setting(ssid,pass)
response = open(GOPROCONTROL + 'command/wireless/ap/ssid?ssid=' + ssid + "&pw=" + passwd).read
response = gpControlCommand('wireless/ap/ssid?ssid=' + ssid + "&pw=" + passwd)
puts response
end

@@ -223,18 +226,18 @@ def reset(option)
puts case option
when Reset::VideoPT
#reset video PT
response = open(GOPROCONTROL + 'command/video/protune/reset').read
response = gpControlCommand('video/protune/reset')
puts response
when Reset::PhotoPT
#reset photo PT
response = open(GOPROCONTROL + 'command/photo/protune/reset').read
response = gpControlCommand('photo/protune/reset')
puts response
when Reset::MultiShotPT
#reset Ms PT
response = open(GOPROCONTROL + 'command/multi_shot/protune/reset').read
response = gpControlCommand('multi_shot/protune/reset')
puts response
when Reset::CamReset
response = open(GOPROCONTROL + 'command/system/factory/reset').read
response = gpControlCommand('system/factory/reset')
puts response
end
end
@@ -289,7 +292,7 @@ def sync_time()
datestr_min=Time.new.min.to_s(16)
datestr_sec=Time.new.sec.to_s(16)
datestr="%"+datestr_year+"%"+datestr_month+"%"+datestr_day+"%"+datestr_hour+"%"+datestr_min+"%"+datestr_sec
response = open(GOPROCONTROL + 'command/setup/date_time?p=' + datestr).read
response = gpControlCommand('setup/date_time?p=' + datestr)
puts response
end
def dl_media()
@@ -328,3 +331,4 @@ def livestream(option)
end
end
end

0 comments on commit fcc6ec6

Please sign in to comment.
You can’t perform that action at this time.